
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/integrals/integrals.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:24:27 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Integrals &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../_static/sympy-notailtext-favicon.ico"/>
    <link href="integrals.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Computing Integrals using Meijer G-Functions" href="g-functions.html" />
    <link rel="prev" title="Inequality Solvers" href="../solvers/inequalities.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="g-functions.html" title="Computing Integrals using Meijer G-Functions"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../solvers/inequalities.html" title="Inequality Solvers"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">SymPy Modules Reference</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Integrals</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="module-sympy.integrals">
<span id="integrals"></span><h1>Integrals<a class="headerlink" href="#module-sympy.integrals" title="Permalink to this headline">¶</a></h1>
<p>The <code class="docutils literal notranslate"><span class="pre">integrals</span></code> module in SymPy implements methods to calculate definite and indefinite integrals of expressions.</p>
<p>Principal method in this module is <a class="reference internal" href="#sympy.integrals.integrals.integrate" title="sympy.integrals.integrals.integrate"><code class="xref py py-func docutils literal notranslate"><span class="pre">integrate()</span></code></a></p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">integrate(f,</span> <span class="pre">x)</span></code> returns the indefinite integral <span class="math notranslate nohighlight">\(\int f\,dx\)</span></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">integrate(f,</span> <span class="pre">(x,</span> <span class="pre">a,</span> <span class="pre">b))</span></code> returns the definite integral <span class="math notranslate nohighlight">\(\int_{a}^{b} f\,dx\)</span></p></li>
</ul>
</div></blockquote>
<section id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<p>SymPy can integrate a vast array of functions. It can integrate polynomial functions:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="o">*</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">init_printing</span><span class="p">(</span><span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">wrap_line</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go"> 3    2</span>
<span class="go">x    x</span>
<span class="go">-- + -- + x</span>
<span class="go">3    2</span>
</pre></div>
</div>
<p>Rational functions:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="o">/</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">+</span><span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="o">+</span><span class="mi">1</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="go">log(x + 1) + -----</span>
<span class="go">x + 1</span>
</pre></div>
</div>
<p>Exponential-polynomial functions. These multiplicative combinations of polynomials and the functions <code class="docutils literal notranslate"><span class="pre">exp</span></code>, <code class="docutils literal notranslate"><span class="pre">cos</span></code> and <code class="docutils literal notranslate"><span class="pre">sin</span></code> can be integrated by hand using repeated integration by parts, which is an extremely tedious process. Happily, SymPy will deal with these integrals.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">*</span> <span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">*</span> <span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go"> 2  x           2  x                         x           x</span>
<span class="go">x *e *sin(x)   x *e *cos(x)      x          e *sin(x)   e *cos(x)</span>
<span class="go">------------ + ------------ - x*e *sin(x) + --------- - ---------</span>
<span class="go">     2              2                           2           2</span>
</pre></div>
</div>
<p>even a few nonelementary integrals (in particular, some integrals involving the error function) can be evaluated:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">*</span><span class="n">erf</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">  ____    2</span>
<span class="go">\/ pi *erf (x)</span>
<span class="go">--------------</span>
<span class="go">      4</span>
</pre></div>
</div>
</section>
<section id="module-sympy.integrals.transforms">
<span id="integral-transforms"></span><h2>Integral Transforms<a class="headerlink" href="#module-sympy.integrals.transforms" title="Permalink to this headline">¶</a></h2>
<p>SymPy has special support for definite integrals, and integral transforms.</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.mellin_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">mellin_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">s</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L344-L386"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.mellin_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the Mellin transform <span class="math notranslate nohighlight">\(F(s)\)</span> of <span class="math notranslate nohighlight">\(f(x)\)</span>,</p>
<div class="math notranslate nohighlight">
\[F(s) = \int_0^\infty x^{s-1} f(x) \mathrm{d}x.\]</div>
<dl class="simple">
<dt>For all “sensible” functions, this converges absolutely in a strip</dt><dd><p><span class="math notranslate nohighlight">\(a &lt; \operatorname{Re}(s) &lt; b\)</span>.</p>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The Mellin transform is related via change of variables to the Fourier
transform, and also to the (bilateral) Laplace transform.</p>
<p>This function returns <code class="docutils literal notranslate"><span class="pre">(F,</span> <span class="pre">(a,</span> <span class="pre">b),</span> <span class="pre">cond)</span></code>
where <code class="docutils literal notranslate"><span class="pre">F</span></code> is the Mellin transform of <code class="docutils literal notranslate"><span class="pre">f</span></code>, <code class="docutils literal notranslate"><span class="pre">(a,</span> <span class="pre">b)</span></code> is the fundamental strip
(as above), and <code class="docutils literal notranslate"><span class="pre">cond</span></code> are auxiliary convergence conditions.</p>
<p>If the integral cannot be computed in closed form, this function returns
an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.MellinTransform" title="sympy.integrals.transforms.MellinTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">MellinTransform</span></code></a> object.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>. If <code class="docutils literal notranslate"><span class="pre">noconds=False</span></code>,
then only <span class="math notranslate nohighlight">\(F\)</span> will be returned (i.e. not <code class="docutils literal notranslate"><span class="pre">cond</span></code>, and also not the strip
<code class="docutils literal notranslate"><span class="pre">(a,</span> <span class="pre">b)</span></code>).</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.transforms</span> <span class="kn">import</span> <span class="n">mellin_transform</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mellin_transform</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="go">(gamma(s), (0, oo), True)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.inverse_mellin_transform" title="sympy.integrals.transforms.inverse_mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.fourier_transform" title="sympy.integrals.transforms.fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.MellinTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">MellinTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L310-L341"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.MellinTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated Mellin transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute Mellin transforms, see the <a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">mellin_transform()</span></code></a>
docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.inverse_mellin_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">inverse_mellin_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">F</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">s</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">strip</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L860-L914"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.inverse_mellin_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the inverse Mellin transform of <span class="math notranslate nohighlight">\(F(s)\)</span> over the fundamental
strip given by <code class="docutils literal notranslate"><span class="pre">strip=(a,</span> <span class="pre">b)</span></code>.</p>
<p class="rubric">Explanation</p>
<p>This can be defined as</p>
<div class="math notranslate nohighlight">
\[f(x) = \frac{1}{2\pi i} \int_{c - i\infty}^{c + i\infty} x^{-s} F(s) \mathrm{d}s,\]</div>
<p>for any <span class="math notranslate nohighlight">\(c\)</span> in the fundamental strip. Under certain regularity
conditions on <span class="math notranslate nohighlight">\(F\)</span> and/or <span class="math notranslate nohighlight">\(f\)</span>,
this recovers <span class="math notranslate nohighlight">\(f\)</span> from its Mellin transform <span class="math notranslate nohighlight">\(F\)</span>
(and vice versa), for positive real <span class="math notranslate nohighlight">\(x\)</span>.</p>
<p>One of <span class="math notranslate nohighlight">\(a\)</span> or <span class="math notranslate nohighlight">\(b\)</span> may be passed as <code class="docutils literal notranslate"><span class="pre">None</span></code>; a suitable <span class="math notranslate nohighlight">\(c\)</span> will be
inferred.</p>
<p>If the integral cannot be computed in closed form, this function returns
an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.InverseMellinTransform" title="sympy.integrals.transforms.InverseMellinTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">InverseMellinTransform</span></code></a> object.</p>
<p>Note that this function will assume x to be positive and real, regardless
of the sympy assumptions!</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.transforms</span> <span class="kn">import</span> <span class="n">inverse_mellin_transform</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">oo</span><span class="p">,</span> <span class="n">gamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_mellin_transform</span><span class="p">(</span><span class="n">gamma</span><span class="p">(</span><span class="n">s</span><span class="p">),</span> <span class="n">s</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">))</span>
<span class="go">exp(-x)</span>
</pre></div>
</div>
<p>The fundamental strip matters:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="mi">1</span><span class="o">/</span><span class="p">(</span><span class="n">s</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_mellin_transform</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
<span class="go">x*(1 - 1/x**2)*Heaviside(x - 1)/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_mellin_transform</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="go">-x*Heaviside(1 - x)/2 - Heaviside(x - 1)/(2*x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_mellin_transform</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">oo</span><span class="p">))</span>
<span class="go">(1/2 - x**2/2)*Heaviside(1 - x)/x</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.InverseMellinTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">InverseMellinTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L807-L857"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.InverseMellinTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated inverse Mellin transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute inverse Mellin transforms, see the
<a class="reference internal" href="#sympy.integrals.transforms.inverse_mellin_transform" title="sympy.integrals.transforms.inverse_mellin_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">inverse_mellin_transform()</span></code></a> docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.laplace_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">laplace_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">t</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">s</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">legacy_matrix</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1178-L1256"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.laplace_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the Laplace Transform <span class="math notranslate nohighlight">\(F(s)\)</span> of <span class="math notranslate nohighlight">\(f(t)\)</span>,</p>
<div class="math notranslate nohighlight">
\[F(s) = \int_{0^{-}}^\infty e^{-st} f(t) \mathrm{d}t.\]</div>
<p class="rubric">Explanation</p>
<p>For all sensible functions, this converges absolutely in a
half plane  <span class="math notranslate nohighlight">\(a &lt; \operatorname{Re}(s)\)</span>.</p>
<p>This function returns <code class="docutils literal notranslate"><span class="pre">(F,</span> <span class="pre">a,</span> <span class="pre">cond)</span></code> where <code class="docutils literal notranslate"><span class="pre">F</span></code> is the Laplace
transform of <code class="docutils literal notranslate"><span class="pre">f</span></code>, <span class="math notranslate nohighlight">\(\operatorname{Re}(s) &gt; a\)</span> is the half-plane
of convergence, and <code class="docutils literal notranslate"><span class="pre">cond</span></code> are auxiliary convergence conditions.</p>
<p>The lower bound is <span class="math notranslate nohighlight">\(0^{-}\)</span>, meaning that this bound should be approached
from the lower side. This is only necessary if distributions are involved.
At present, it is only done if <span class="math notranslate nohighlight">\(f(t)\)</span> contains <code class="docutils literal notranslate"><span class="pre">DiracDelta</span></code>, in which
case the Laplace transform is computed as</p>
<div class="math notranslate nohighlight">
\[F(s) = \lim_{\tau\to 0^{-}} \int_{\tau}^\infty e^{-st} f(t) \mathrm{d}t.\]</div>
<p>If the integral cannot be computed in closed form, this function returns
an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.LaplaceTransform" title="sympy.integrals.transforms.LaplaceTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">LaplaceTransform</span></code></a> object.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>. If <code class="docutils literal notranslate"><span class="pre">noconds=True</span></code>,
only <span class="math notranslate nohighlight">\(F\)</span> will be returned (i.e. not <code class="docutils literal notranslate"><span class="pre">cond</span></code>, and also not the plane <code class="docutils literal notranslate"><span class="pre">a</span></code>).</p>
<div class="deprecated">
<p><span class="versionmodified deprecated">Deprecated since version 1.9: </span>Legacy behavior for matrices where <code class="docutils literal notranslate"><span class="pre">laplace_transform</span></code> with
<code class="docutils literal notranslate"><span class="pre">noconds=False</span></code> (the default) returns a Matrix whose elements are
tuples. The behavior of <code class="docutils literal notranslate"><span class="pre">laplace_transform</span></code> for matrices will change
in a future release of SymPy to return a tuple of the transformed
Matrix and the convergence conditions for the matrix as a whole. Use
<code class="docutils literal notranslate"><span class="pre">legacy_matrix=False</span></code> to enable the new behavior.</p>
</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals</span> <span class="kn">import</span> <span class="n">laplace_transform</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">t</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions</span> <span class="kn">import</span> <span class="n">DiracDelta</span><span class="p">,</span> <span class="n">exp</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">laplace_transform</span><span class="p">(</span><span class="n">t</span><span class="o">**</span><span class="n">a</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span>
<span class="go">(gamma(a + 1)/(s*s**a), 0, re(a) &gt; -1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">laplace_transform</span><span class="p">(</span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">t</span><span class="p">)</span><span class="o">-</span><span class="n">a</span><span class="o">*</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">a</span><span class="o">*</span><span class="n">t</span><span class="p">),</span><span class="n">t</span><span class="p">,</span><span class="n">s</span><span class="p">)</span>
<span class="go">(-a/(a + s) + 1, 0, Abs(arg(a)) &lt;= pi/2)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.inverse_laplace_transform" title="sympy.integrals.transforms.inverse_laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_laplace_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.fourier_transform" title="sympy.integrals.transforms.fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.LaplaceTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">LaplaceTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1144-L1175"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.LaplaceTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated Laplace transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute Laplace transforms, see the <a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">laplace_transform()</span></code></a>
docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.inverse_laplace_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">inverse_laplace_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">F</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">s</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">t</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">plane</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1376-L1422"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.inverse_laplace_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the inverse Laplace transform of <span class="math notranslate nohighlight">\(F(s)\)</span>, defined as</p>
<div class="math notranslate nohighlight">
\[f(t) = \frac{1}{2\pi i} \int_{c-i\infty}^{c+i\infty} e^{st} F(s) \mathrm{d}s,\]</div>
<p>for <span class="math notranslate nohighlight">\(c\)</span> so large that <span class="math notranslate nohighlight">\(F(s)\)</span> has no singularites in the
half-plane <span class="math notranslate nohighlight">\(\operatorname{Re}(s) &gt; c-\epsilon\)</span>.</p>
<p class="rubric">Explanation</p>
<p>The plane can be specified by
argument <code class="docutils literal notranslate"><span class="pre">plane</span></code>, but will be inferred if passed as None.</p>
<p>Under certain regularity conditions, this recovers <span class="math notranslate nohighlight">\(f(t)\)</span> from its
Laplace Transform <span class="math notranslate nohighlight">\(F(s)\)</span>, for non-negative <span class="math notranslate nohighlight">\(t\)</span>, and vice
versa.</p>
<p>If the integral cannot be computed in closed form, this function returns
an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.InverseLaplaceTransform" title="sympy.integrals.transforms.InverseLaplaceTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">InverseLaplaceTransform</span></code></a> object.</p>
<p>Note that this function will always assume <span class="math notranslate nohighlight">\(t\)</span> to be real,
regardless of the sympy assumption on <span class="math notranslate nohighlight">\(t\)</span>.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.transforms</span> <span class="kn">import</span> <span class="n">inverse_laplace_transform</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">t</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_laplace_transform</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">a</span><span class="o">*</span><span class="n">s</span><span class="p">)</span><span class="o">/</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">t</span><span class="p">)</span>
<span class="go">Heaviside(-a + t)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms._fast_inverse_laplace" title="sympy.integrals.transforms._fast_inverse_laplace"><code class="xref py py-obj docutils literal notranslate"><span class="pre">_fast_inverse_laplace</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.InverseLaplaceTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">InverseLaplaceTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1341-L1373"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.InverseLaplaceTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated inverse Laplace transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute inverse Laplace transforms, see the
<a class="reference internal" href="#sympy.integrals.transforms.inverse_laplace_transform" title="sympy.integrals.transforms.inverse_laplace_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">inverse_laplace_transform()</span></code></a> docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms._fast_inverse_laplace">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">_fast_inverse_laplace</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">e</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">s</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">t</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1425-L1467"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms._fast_inverse_laplace" title="Permalink to this definition">¶</a></dt>
<dd><p>Fast inverse Laplace transform of rational function including RootSum</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.fourier_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">fourier_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1548-L1587"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.fourier_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the unitary, ordinary-frequency Fourier transform of <code class="docutils literal notranslate"><span class="pre">f</span></code>, defined
as</p>
<div class="math notranslate nohighlight">
\[F(k) = \int_{-\infty}^\infty f(x) e^{-2\pi i x k} \mathrm{d} x.\]</div>
<p class="rubric">Explanation</p>
<p>If the transform cannot be computed in closed form, this
function returns an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.FourierTransform" title="sympy.integrals.transforms.FourierTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">FourierTransform</span></code></a> object.</p>
<p>For other Fourier transform conventions, see the function
<a class="reference internal" href="#sympy.integrals.transforms._fourier_transform" title="sympy.integrals.transforms._fourier_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms._fourier_transform()</span></code></a>.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>.
Note that for this transform, by default <code class="docutils literal notranslate"><span class="pre">noconds=True</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">fourier_transform</span><span class="p">,</span> <span class="n">exp</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fourier_transform</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
<span class="go">sqrt(pi)*exp(-pi**2*k**2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fourier_transform</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">noconds</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">(sqrt(pi)*exp(-pi**2*k**2), True)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.inverse_fourier_transform" title="sympy.integrals.transforms.inverse_fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.sine_transform" title="sympy.integrals.transforms.sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_sine_transform" title="sympy.integrals.transforms.inverse_sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.cosine_transform" title="sympy.integrals.transforms.cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_cosine_transform" title="sympy.integrals.transforms.inverse_cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms._fourier_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">_fourier_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">simplify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1474-L1503"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms._fourier_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute a general Fourier-type transform</p>
<div class="math notranslate nohighlight">
\[F(k) = a \int_{-\infty}^{\infty} e^{bixk} f(x)\, dx.\]</div>
<p>For suitable choice of <em>a</em> and <em>b</em>, this reduces to the standard Fourier
and inverse Fourier transforms.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.FourierTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">FourierTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1529-L1545"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.FourierTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated Fourier transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute Fourier transforms, see the <a class="reference internal" href="#sympy.integrals.transforms.fourier_transform" title="sympy.integrals.transforms.fourier_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">fourier_transform()</span></code></a>
docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.inverse_fourier_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">inverse_fourier_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">F</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1609-L1648"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.inverse_fourier_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the unitary, ordinary-frequency inverse Fourier transform of <span class="math notranslate nohighlight">\(F\)</span>,
defined as</p>
<div class="math notranslate nohighlight">
\[f(x) = \int_{-\infty}^\infty F(k) e^{2\pi i x k} \mathrm{d} k.\]</div>
<p class="rubric">Explanation</p>
<p>If the transform cannot be computed in closed form, this
function returns an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.InverseFourierTransform" title="sympy.integrals.transforms.InverseFourierTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">InverseFourierTransform</span></code></a> object.</p>
<p>For other Fourier transform conventions, see the function
<a class="reference internal" href="#sympy.integrals.transforms._fourier_transform" title="sympy.integrals.transforms._fourier_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms._fourier_transform()</span></code></a>.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>.
Note that for this transform, by default <code class="docutils literal notranslate"><span class="pre">noconds=True</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">inverse_fourier_transform</span><span class="p">,</span> <span class="n">exp</span><span class="p">,</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_fourier_transform</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="n">pi</span><span class="p">)</span><span class="o">*</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="p">(</span><span class="n">pi</span><span class="o">*</span><span class="n">k</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">k</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">exp(-x**2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_fourier_transform</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="n">pi</span><span class="p">)</span><span class="o">*</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="p">(</span><span class="n">pi</span><span class="o">*</span><span class="n">k</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">k</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">noconds</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">(exp(-x**2), True)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.fourier_transform" title="sympy.integrals.transforms.fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.sine_transform" title="sympy.integrals.transforms.sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_sine_transform" title="sympy.integrals.transforms.inverse_sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.cosine_transform" title="sympy.integrals.transforms.cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_cosine_transform" title="sympy.integrals.transforms.inverse_cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.InverseFourierTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">InverseFourierTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1590-L1606"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.InverseFourierTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated inverse Fourier transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute inverse Fourier transforms, see the
<a class="reference internal" href="#sympy.integrals.transforms.inverse_fourier_transform" title="sympy.integrals.transforms.inverse_fourier_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">inverse_fourier_transform()</span></code></a> docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.sine_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">sine_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1731-L1767"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.sine_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the unitary, ordinary-frequency sine transform of <span class="math notranslate nohighlight">\(f\)</span>, defined
as</p>
<div class="math notranslate nohighlight">
\[F(k) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty f(x) \sin(2\pi x k) \mathrm{d} x.\]</div>
<p class="rubric">Explanation</p>
<p>If the transform cannot be computed in closed form, this
function returns an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.SineTransform" title="sympy.integrals.transforms.SineTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">SineTransform</span></code></a> object.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>.
Note that for this transform, by default <code class="docutils literal notranslate"><span class="pre">noconds=True</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sine_transform</span><span class="p">,</span> <span class="n">exp</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sine_transform</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">a</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
<span class="go">sqrt(2)*k*exp(-k**2/(4*a))/(4*a**(3/2))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sine_transform</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="p">(</span><span class="o">-</span><span class="n">a</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
<span class="go">2**(1/2 - a)*k**(a - 1)*gamma(1 - a/2)/gamma(a/2 + 1/2)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.fourier_transform" title="sympy.integrals.transforms.fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_fourier_transform" title="sympy.integrals.transforms.inverse_fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_sine_transform" title="sympy.integrals.transforms.inverse_sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.cosine_transform" title="sympy.integrals.transforms.cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_cosine_transform" title="sympy.integrals.transforms.inverse_cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.SineTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">SineTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1711-L1728"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.SineTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated sine transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute sine transforms, see the <a class="reference internal" href="#sympy.integrals.transforms.sine_transform" title="sympy.integrals.transforms.sine_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">sine_transform()</span></code></a>
docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.inverse_sine_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">inverse_sine_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">F</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1790-L1827"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.inverse_sine_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the unitary, ordinary-frequency inverse sine transform of <span class="math notranslate nohighlight">\(F\)</span>,
defined as</p>
<div class="math notranslate nohighlight">
\[f(x) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty F(k) \sin(2\pi x k) \mathrm{d} k.\]</div>
<p class="rubric">Explanation</p>
<p>If the transform cannot be computed in closed form, this
function returns an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.InverseSineTransform" title="sympy.integrals.transforms.InverseSineTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">InverseSineTransform</span></code></a> object.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>.
Note that for this transform, by default <code class="docutils literal notranslate"><span class="pre">noconds=True</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">inverse_sine_transform</span><span class="p">,</span> <span class="n">exp</span><span class="p">,</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">gamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_sine_transform</span><span class="p">(</span><span class="mi">2</span><span class="o">**</span><span class="p">((</span><span class="mi">1</span><span class="o">-</span><span class="mi">2</span><span class="o">*</span><span class="n">a</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span><span class="o">*</span><span class="n">k</span><span class="o">**</span><span class="p">(</span><span class="n">a</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span><span class="o">*</span>
<span class="gp">... </span>    <span class="n">gamma</span><span class="p">(</span><span class="o">-</span><span class="n">a</span><span class="o">/</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="n">gamma</span><span class="p">((</span><span class="n">a</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">),</span> <span class="n">k</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x**(-a)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_sine_transform</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">*</span><span class="n">k</span><span class="o">*</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">k</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="p">(</span><span class="mi">4</span><span class="o">*</span><span class="n">a</span><span class="p">))</span><span class="o">/</span><span class="p">(</span><span class="mi">4</span><span class="o">*</span><span class="n">sqrt</span><span class="p">(</span><span class="n">a</span><span class="p">)</span><span class="o">**</span><span class="mi">3</span><span class="p">),</span> <span class="n">k</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x*exp(-a*x**2)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.fourier_transform" title="sympy.integrals.transforms.fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_fourier_transform" title="sympy.integrals.transforms.inverse_fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.sine_transform" title="sympy.integrals.transforms.sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.cosine_transform" title="sympy.integrals.transforms.cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_cosine_transform" title="sympy.integrals.transforms.inverse_cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.InverseSineTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">InverseSineTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1770-L1787"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.InverseSineTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated inverse sine transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute inverse sine transforms, see the
<a class="reference internal" href="#sympy.integrals.transforms.inverse_sine_transform" title="sympy.integrals.transforms.inverse_sine_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">inverse_sine_transform()</span></code></a> docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.cosine_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">cosine_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1850-L1886"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.cosine_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the unitary, ordinary-frequency cosine transform of <span class="math notranslate nohighlight">\(f\)</span>, defined
as</p>
<div class="math notranslate nohighlight">
\[F(k) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty f(x) \cos(2\pi x k) \mathrm{d} x.\]</div>
<p class="rubric">Explanation</p>
<p>If the transform cannot be computed in closed form, this
function returns an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.CosineTransform" title="sympy.integrals.transforms.CosineTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">CosineTransform</span></code></a> object.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>.
Note that for this transform, by default <code class="docutils literal notranslate"><span class="pre">noconds=True</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">cosine_transform</span><span class="p">,</span> <span class="n">exp</span><span class="p">,</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">cos</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cosine_transform</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">a</span><span class="o">*</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
<span class="go">sqrt(2)*a/(sqrt(pi)*(a**2 + k**2))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cosine_transform</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">a</span><span class="o">*</span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="p">))</span><span class="o">*</span><span class="n">cos</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="p">)),</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
<span class="go">a*exp(-a**2/(2*k))/(2*k**(3/2))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.fourier_transform" title="sympy.integrals.transforms.fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_fourier_transform" title="sympy.integrals.transforms.inverse_fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.sine_transform" title="sympy.integrals.transforms.sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_sine_transform" title="sympy.integrals.transforms.inverse_sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_cosine_transform" title="sympy.integrals.transforms.inverse_cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.CosineTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">CosineTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1830-L1847"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.CosineTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated cosine transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute cosine transforms, see the <a class="reference internal" href="#sympy.integrals.transforms.cosine_transform" title="sympy.integrals.transforms.cosine_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">cosine_transform()</span></code></a>
docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.inverse_cosine_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">inverse_cosine_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">F</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1909-L1945"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.inverse_cosine_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the unitary, ordinary-frequency inverse cosine transform of <span class="math notranslate nohighlight">\(F\)</span>,
defined as</p>
<div class="math notranslate nohighlight">
\[f(x) = \sqrt{\frac{2}{\pi}} \int_{0}^\infty F(k) \cos(2\pi x k) \mathrm{d} k.\]</div>
<p class="rubric">Explanation</p>
<p>If the transform cannot be computed in closed form, this
function returns an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.InverseCosineTransform" title="sympy.integrals.transforms.InverseCosineTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">InverseCosineTransform</span></code></a> object.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>.
Note that for this transform, by default <code class="docutils literal notranslate"><span class="pre">noconds=True</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">inverse_cosine_transform</span><span class="p">,</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_cosine_transform</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">*</span><span class="n">a</span><span class="o">/</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="n">pi</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">a</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">k</span><span class="o">**</span><span class="mi">2</span><span class="p">)),</span> <span class="n">k</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">exp(-a*x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_cosine_transform</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="n">sqrt</span><span class="p">(</span><span class="n">k</span><span class="p">),</span> <span class="n">k</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1/sqrt(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.fourier_transform" title="sympy.integrals.transforms.fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_fourier_transform" title="sympy.integrals.transforms.inverse_fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.sine_transform" title="sympy.integrals.transforms.sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_sine_transform" title="sympy.integrals.transforms.inverse_sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.cosine_transform" title="sympy.integrals.transforms.cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.InverseCosineTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">InverseCosineTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L1889-L1906"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.InverseCosineTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated inverse cosine transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute inverse cosine transforms, see the
<a class="reference internal" href="#sympy.integrals.transforms.inverse_cosine_transform" title="sympy.integrals.transforms.inverse_cosine_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">inverse_cosine_transform()</span></code></a> docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.hankel_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">hankel_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">r</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L2015-L2061"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.hankel_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the Hankel transform of <span class="math notranslate nohighlight">\(f\)</span>, defined as</p>
<div class="math notranslate nohighlight">
\[F_\nu(k) = \int_{0}^\infty f(r) J_\nu(k r) r \mathrm{d} r.\]</div>
<p class="rubric">Explanation</p>
<p>If the transform cannot be computed in closed form, this
function returns an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.HankelTransform" title="sympy.integrals.transforms.HankelTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">HankelTransform</span></code></a> object.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>.
Note that for this transform, by default <code class="docutils literal notranslate"><span class="pre">noconds=True</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hankel_transform</span><span class="p">,</span> <span class="n">inverse_hankel_transform</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">r</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">nu</span><span class="p">,</span> <span class="n">a</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ht</span> <span class="o">=</span> <span class="n">hankel_transform</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="n">r</span><span class="o">**</span><span class="n">m</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">nu</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ht</span>
<span class="go">2*k**(m - 2)*gamma(-m/2 + nu/2 + 1)/(2**m*gamma(m/2 + nu/2))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_hankel_transform</span><span class="p">(</span><span class="n">ht</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="n">nu</span><span class="p">)</span>
<span class="go">r**(-m)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ht</span> <span class="o">=</span> <span class="n">hankel_transform</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">a</span><span class="o">*</span><span class="n">r</span><span class="p">),</span> <span class="n">r</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ht</span>
<span class="go">a/(k**3*(a**2/k**2 + 1)**(3/2))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_hankel_transform</span><span class="p">(</span><span class="n">ht</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">exp(-a*r)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.fourier_transform" title="sympy.integrals.transforms.fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_fourier_transform" title="sympy.integrals.transforms.inverse_fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.sine_transform" title="sympy.integrals.transforms.sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_sine_transform" title="sympy.integrals.transforms.inverse_sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.cosine_transform" title="sympy.integrals.transforms.cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_cosine_transform" title="sympy.integrals.transforms.inverse_cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.HankelTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">HankelTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L2002-L2012"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.HankelTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated Hankel transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute Hankel transforms, see the <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">hankel_transform()</span></code></a>
docstring.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.transforms.inverse_hankel_transform">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">inverse_hankel_transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">F</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">r</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L2077-L2123"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.inverse_hankel_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the inverse Hankel transform of <span class="math notranslate nohighlight">\(F\)</span> defined as</p>
<div class="math notranslate nohighlight">
\[f(r) = \int_{0}^\infty F_\nu(k) J_\nu(k r) k \mathrm{d} k.\]</div>
<p class="rubric">Explanation</p>
<p>If the transform cannot be computed in closed form, this
function returns an unevaluated <a class="reference internal" href="#sympy.integrals.transforms.InverseHankelTransform" title="sympy.integrals.transforms.InverseHankelTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">InverseHankelTransform</span></code></a> object.</p>
<p>For a description of possible hints, refer to the docstring of
<a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform.doit" title="sympy.integrals.transforms.IntegralTransform.doit"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.integrals.transforms.IntegralTransform.doit()</span></code></a>.
Note that for this transform, by default <code class="docutils literal notranslate"><span class="pre">noconds=True</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hankel_transform</span><span class="p">,</span> <span class="n">inverse_hankel_transform</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">r</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">nu</span><span class="p">,</span> <span class="n">a</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ht</span> <span class="o">=</span> <span class="n">hankel_transform</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="n">r</span><span class="o">**</span><span class="n">m</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">nu</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ht</span>
<span class="go">2*k**(m - 2)*gamma(-m/2 + nu/2 + 1)/(2**m*gamma(m/2 + nu/2))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_hankel_transform</span><span class="p">(</span><span class="n">ht</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="n">nu</span><span class="p">)</span>
<span class="go">r**(-m)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ht</span> <span class="o">=</span> <span class="n">hankel_transform</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">a</span><span class="o">*</span><span class="n">r</span><span class="p">),</span> <span class="n">r</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ht</span>
<span class="go">a/(k**3*(a**2/k**2 + 1)**(3/2))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">inverse_hankel_transform</span><span class="p">(</span><span class="n">ht</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">exp(-a*r)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.transforms.fourier_transform" title="sympy.integrals.transforms.fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_fourier_transform" title="sympy.integrals.transforms.inverse_fourier_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_fourier_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.sine_transform" title="sympy.integrals.transforms.sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_sine_transform" title="sympy.integrals.transforms.inverse_sine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_sine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.cosine_transform" title="sympy.integrals.transforms.cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.inverse_cosine_transform" title="sympy.integrals.transforms.inverse_cosine_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">inverse_cosine_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.hankel_transform" title="sympy.integrals.transforms.hankel_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.mellin_transform" title="sympy.integrals.transforms.mellin_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mellin_transform</span></code></a>, <a class="reference internal" href="#sympy.integrals.transforms.laplace_transform" title="sympy.integrals.transforms.laplace_transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace_transform</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.InverseHankelTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">InverseHankelTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L2064-L2074"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.InverseHankelTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing unevaluated inverse Hankel transforms.</p>
<p>For usage of this class, see the <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransform" title="sympy.integrals.transforms.IntegralTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">IntegralTransform</span></code></a> docstring.</p>
<p>For how to compute inverse Hankel transforms, see the
<a class="reference internal" href="#sympy.integrals.transforms.inverse_hankel_transform" title="sympy.integrals.transforms.inverse_hankel_transform"><code class="xref py py-func docutils literal notranslate"><span class="pre">inverse_hankel_transform()</span></code></a> docstring.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.transforms.IntegralTransform">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">IntegralTransform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L49-L189"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.IntegralTransform" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for integral transforms.</p>
<p class="rubric">Explanation</p>
<p>This class represents unevaluated transforms.</p>
<p>To implement a concrete transform, derive from this class and implement
the <code class="docutils literal notranslate"><span class="pre">_compute_transform(f,</span> <span class="pre">x,</span> <span class="pre">s,</span> <span class="pre">**hints)</span></code> and <code class="docutils literal notranslate"><span class="pre">_as_integral(f,</span> <span class="pre">x,</span> <span class="pre">s)</span></code>
functions. If the transform cannot be computed, raise <a class="reference internal" href="#sympy.integrals.transforms.IntegralTransformError" title="sympy.integrals.transforms.IntegralTransformError"><code class="xref py py-obj docutils literal notranslate"><span class="pre">IntegralTransformError</span></code></a>.</p>
<p>Also set <code class="docutils literal notranslate"><span class="pre">cls._name</span></code>. For instance,</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.transforms</span> <span class="kn">import</span> <span class="n">LaplaceTransform</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">LaplaceTransform</span><span class="o">.</span><span class="n">_name</span>
<span class="go">&#39;Laplace&#39;</span>
</pre></div>
</div>
<p>Implement <code class="docutils literal notranslate"><span class="pre">self._collapse_extra</span></code> if your function returns more than just a
number and possibly a convergence condition.</p>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.integrals.transforms.IntegralTransform.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L108-L181"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.IntegralTransform.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Try to evaluate the transform in closed form.</p>
<p class="rubric">Explanation</p>
<p>This general function handles linearity, but apart from that leaves
pretty much everything to _compute_transform.</p>
<p>Standard hints are the following:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">simplify</span></code>: whether or not to simplify the result</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">noconds</span></code>: if True, don’t return convergence conditions</p></li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">needeval</span></code>: if True, raise IntegralTransformError instead of</dt><dd><p>returning IntegralTransform objects</p>
</dd>
</dl>
</li>
</ul>
<p>The default values of these hints depend on the concrete transform,
usually the default is
<code class="docutils literal notranslate"><span class="pre">(simplify,</span> <span class="pre">noconds,</span> <span class="pre">needeval)</span> <span class="pre">=</span> <span class="pre">(True,</span> <span class="pre">False,</span> <span class="pre">False)</span></code>.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.integrals.transforms.IntegralTransform.function">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">function</span></span><a class="headerlink" href="#sympy.integrals.transforms.IntegralTransform.function" title="Permalink to this definition">¶</a></dt>
<dd><p>The function to be transformed.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.integrals.transforms.IntegralTransform.function_variable">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">function_variable</span></span><a class="headerlink" href="#sympy.integrals.transforms.IntegralTransform.function_variable" title="Permalink to this definition">¶</a></dt>
<dd><p>The dependent variable of the function to be transformed.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.integrals.transforms.IntegralTransform.transform_variable">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">transform_variable</span></span><a class="headerlink" href="#sympy.integrals.transforms.IntegralTransform.transform_variable" title="Permalink to this definition">¶</a></dt>
<dd><p>The independent transform variable.</p>
</dd></dl>

</dd></dl>

<dl class="py exception">
<dt class="sig sig-object py" id="sympy.integrals.transforms.IntegralTransformError">
<em class="property"><span class="pre">exception</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.transforms.</span></span><span class="sig-name descname"><span class="pre">IntegralTransformError</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">transform</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">function</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/transforms.py#L29-L46"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.transforms.IntegralTransformError" title="Permalink to this definition">¶</a></dt>
<dd><p>Exception raised in relation to problems computing transforms.</p>
<p class="rubric">Explanation</p>
<p>This class is mostly used internally; if integrals cannot be computed
objects representing unevaluated transforms are usually returned.</p>
<p>The hint <code class="docutils literal notranslate"><span class="pre">needeval=True</span></code> can be used to disable returning transform
objects, and instead raise this exception if an integral cannot be
computed.</p>
</dd></dl>

</section>
<section id="internals">
<h2>Internals<a class="headerlink" href="#internals" title="Permalink to this headline">¶</a></h2>
<p>SymPy uses a number of algorithms to compute integrals. Algorithms are tried
in order until one produces an answer. Most of these algorithms can be enabled
or disabled manually using various flags to <a class="reference internal" href="#sympy.integrals.integrals.integrate" title="sympy.integrals.integrals.integrate"><code class="xref py py-func docutils literal notranslate"><span class="pre">integrate()</span></code></a> or <a class="reference internal" href="#sympy.integrals.integrals.Integral.doit" title="sympy.integrals.integrals.Integral.doit"><code class="xref py py-meth docutils literal notranslate"><span class="pre">doit()</span></code></a>.</p>
<p>SymPy first applies several heuristic algorithms, as these are the fastest:</p>
<ol class="arabic">
<li><p>If the function is a rational function, there is a complete algorithm for
integrating rational functions called the Lazard-Rioboo-Trager and the
Horowitz-Ostrogradsky algorithms. They are implemented in <a class="reference internal" href="#sympy.integrals.rationaltools.ratint" title="sympy.integrals.rationaltools.ratint"><code class="xref py py-func docutils literal notranslate"><span class="pre">ratint()</span></code></a>.</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.rationaltools.ratint">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.rationaltools.</span></span><span class="sig-name descname"><span class="pre">ratint</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">flags</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/rationaltools.py#L8-L115"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.rationaltools.ratint" title="Permalink to this definition">¶</a></dt>
<dd><p>Performs indefinite integration of rational functions.</p>
<p class="rubric">Explanation</p>
<p>Given a field <span class="math notranslate nohighlight">\(K\)</span> and a rational function <span class="math notranslate nohighlight">\(f = p/q\)</span>,
where <span class="math notranslate nohighlight">\(p\)</span> and <span class="math notranslate nohighlight">\(q\)</span> are polynomials in <span class="math notranslate nohighlight">\(K[x]\)</span>,
returns a function <span class="math notranslate nohighlight">\(g\)</span> such that <span class="math notranslate nohighlight">\(f = g'\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.rationaltools</span> <span class="kn">import</span> <span class="n">ratint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ratint</span><span class="p">(</span><span class="mi">36</span><span class="o">/</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">5</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">4</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">x</span> <span class="o">-</span> <span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">(12*x + 6)/(x**2 - 1) + 4*log(x - 2) - 4*log(x + 1)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.integrals.Integral.doit" title="sympy.integrals.integrals.Integral.doit"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.Integral.doit</span></code></a>, <a class="reference internal" href="#sympy.integrals.rationaltools.ratint_logpart" title="sympy.integrals.rationaltools.ratint_logpart"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.rationaltools.ratint_logpart</span></code></a>, <a class="reference internal" href="#sympy.integrals.rationaltools.ratint_ratpart" title="sympy.integrals.rationaltools.ratint_ratpart"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.rationaltools.ratint_ratpart</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r489"><span class="brackets"><a class="fn-backref" href="#id1">R489</a></span></dt>
<dd><p>M. Bronstein, Symbolic Integration I: Transcendental
Functions, Second Edition, Springer-Verlag, 2005, pp. 35-70</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.rationaltools.ratint_ratpart">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.rationaltools.</span></span><span class="sig-name descname"><span class="pre">ratint_ratpart</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">g</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/rationaltools.py#L118-L178"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.rationaltools.ratint_ratpart" title="Permalink to this definition">¶</a></dt>
<dd><p>Horowitz-Ostrogradsky algorithm.</p>
<p class="rubric">Explanation</p>
<p>Given a field K and polynomials f and g in K[x], such that f and g
are coprime and deg(f) &lt; deg(g), returns fractions A and B in K(x),
such that f/g = A’ + B and B has square-free denominator.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.rationaltools</span> <span class="kn">import</span> <span class="n">ratint_ratpart</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Poly</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ratint_ratpart</span><span class="p">(</span><span class="n">Poly</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;ZZ&#39;</span><span class="p">),</span>
<span class="gp">... </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;ZZ&#39;</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">(0, 1/(x + 1))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ratint_ratpart</span><span class="p">(</span><span class="n">Poly</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;EX&#39;</span><span class="p">),</span>
<span class="gp">... </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;EX&#39;</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">(0, 1/(x**2 + y**2))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ratint_ratpart</span><span class="p">(</span><span class="n">Poly</span><span class="p">(</span><span class="mi">36</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;ZZ&#39;</span><span class="p">),</span>
<span class="gp">... </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">5</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">4</span> <span class="o">-</span> <span class="mi">2</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span> <span class="o">+</span> <span class="mi">4</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">x</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;ZZ&#39;</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">((12*x + 6)/(x**2 - 1), 12/(x**2 - x - 2))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.rationaltools.ratint" title="sympy.integrals.rationaltools.ratint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ratint</span></code></a>, <a class="reference internal" href="#sympy.integrals.rationaltools.ratint_logpart" title="sympy.integrals.rationaltools.ratint_logpart"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ratint_logpart</span></code></a></p>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.rationaltools.ratint_logpart">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.rationaltools.</span></span><span class="sig-name descname"><span class="pre">ratint_logpart</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">g</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">t</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/rationaltools.py#L181-L269"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.rationaltools.ratint_logpart" title="Permalink to this definition">¶</a></dt>
<dd><p>Lazard-Rioboo-Trager algorithm.</p>
<p class="rubric">Explanation</p>
<p>Given a field K and polynomials f and g in K[x], such that f and g
are coprime, deg(f) &lt; deg(g) and g is square-free, returns a list
of tuples (s_i, q_i) of polynomials, for i = 1..n, such that s_i
in K[t, x] and q_i in K[t], and:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>          ___    ___
d  f   d  \  `   \  `
-- - = --  )      )   a log(s_i(a, x))
dx g   dx /__,   /__,
         i=1..n a | q_i(a) = 0
</pre></div>
</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.rationaltools</span> <span class="kn">import</span> <span class="n">ratint_logpart</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Poly</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ratint_logpart</span><span class="p">(</span><span class="n">Poly</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;ZZ&#39;</span><span class="p">),</span>
<span class="gp">... </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;ZZ&#39;</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">[(Poly(x + 3*_t/2 + 1/2, x, domain=&#39;QQ[_t]&#39;),</span>
<span class="go">...Poly(3*_t**2 + 1, _t, domain=&#39;ZZ&#39;))]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ratint_logpart</span><span class="p">(</span><span class="n">Poly</span><span class="p">(</span><span class="mi">12</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;ZZ&#39;</span><span class="p">),</span>
<span class="gp">... </span><span class="n">Poly</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">x</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">domain</span><span class="o">=</span><span class="s1">&#39;ZZ&#39;</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">[(Poly(x - 3*_t/8 - 1/2, x, domain=&#39;QQ[_t]&#39;),</span>
<span class="go">...Poly(-_t**2 + 16, _t, domain=&#39;ZZ&#39;))]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.rationaltools.ratint" title="sympy.integrals.rationaltools.ratint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ratint</span></code></a>, <a class="reference internal" href="#sympy.integrals.rationaltools.ratint_ratpart" title="sympy.integrals.rationaltools.ratint_ratpart"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ratint_ratpart</span></code></a></p>
</div>
</dd></dl>

</li>
<li><p><a class="reference internal" href="#sympy.integrals.trigonometry.trigintegrate" title="sympy.integrals.trigonometry.trigintegrate"><code class="xref py py-func docutils literal notranslate"><span class="pre">trigintegrate()</span></code></a> solves integrals of trigonometric functions using
pattern matching</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.trigonometry.trigintegrate">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.trigonometry.</span></span><span class="sig-name descname"><span class="pre">trigintegrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">conds</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'piecewise'</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/trigonometry.py#L28-L248"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.trigonometry.trigintegrate" title="Permalink to this definition">¶</a></dt>
<dd><p>Integrate f = Mul(trig) over x.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sin</span><span class="p">,</span> <span class="n">cos</span><span class="p">,</span> <span class="n">tan</span><span class="p">,</span> <span class="n">sec</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.trigonometry</span> <span class="kn">import</span> <span class="n">trigintegrate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">trigintegrate</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">*</span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">sin(x)**2/2</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">trigintegrate</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x/2 - sin(x)*cos(x)/2</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">trigintegrate</span><span class="p">(</span><span class="n">tan</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">*</span><span class="n">sec</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1/cos(x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">trigintegrate</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">*</span><span class="n">tan</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-log(sin(x) - 1)/2 + log(sin(x) + 1)/2 - sin(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.integrals.Integral.doit" title="sympy.integrals.integrals.Integral.doit"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.Integral.doit</span></code></a>, <a class="reference internal" href="#sympy.integrals.integrals.Integral" title="sympy.integrals.integrals.Integral"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.Integral</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r490"><span class="brackets"><a class="fn-backref" href="#id2">R490</a></span></dt>
<dd><p><a class="reference external" href="http://en.wikibooks.org/wiki/Calculus/Integration_techniques">http://en.wikibooks.org/wiki/Calculus/Integration_techniques</a></p>
</dd>
</dl>
</dd></dl>

</li>
<li><p><a class="reference internal" href="#sympy.integrals.deltafunctions.deltaintegrate" title="sympy.integrals.deltafunctions.deltaintegrate"><code class="xref py py-func docutils literal notranslate"><span class="pre">deltaintegrate()</span></code></a> solves integrals with <a class="reference internal" href="../functions/special.html#sympy.functions.special.delta_functions.DiracDelta" title="sympy.functions.special.delta_functions.DiracDelta"><code class="xref py py-class docutils literal notranslate"><span class="pre">DiracDelta</span></code></a> objects.</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.deltafunctions.deltaintegrate">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.deltafunctions.</span></span><span class="sig-name descname"><span class="pre">deltaintegrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/deltafunctions.py#L80-L202"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.deltafunctions.deltaintegrate" title="Permalink to this definition">¶</a></dt>
<dd><p class="rubric">Explanation</p>
<p>The idea for integration is the following:</p>
<ul>
<li><p>If we are dealing with a DiracDelta expression, i.e. DiracDelta(g(x)),
we try to simplify it.</p>
<p>If we could simplify it, then we integrate the resulting expression.
We already know we can integrate a simplified expression, because only
simple DiracDelta expressions are involved.</p>
<p>If we couldn’t simplify it, there are two cases:</p>
<ol class="arabic simple">
<li><p>The expression is a simple expression: we return the integral,
taking care if we are dealing with a Derivative or with a proper
DiracDelta.</p></li>
<li><p>The expression is not simple (i.e. DiracDelta(cos(x))): we can do
nothing at all.</p></li>
</ol>
</li>
<li><p>If the node is a multiplication node having a DiracDelta term:</p>
<p>First we expand it.</p>
<p>If the expansion did work, then we try to integrate the expansion.</p>
<p>If not, we try to extract a simple DiracDelta term, then we have two
cases:</p>
<ol class="arabic simple">
<li><p>We have a simple DiracDelta term, so we return the integral.</p></li>
<li><p>We didn’t have a simple term, but we do have an expression with
simplified DiracDelta terms, so we integrate this expression.</p></li>
</ol>
</li>
</ul>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.deltafunctions</span> <span class="kn">import</span> <span class="n">deltaintegrate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sin</span><span class="p">,</span> <span class="n">cos</span><span class="p">,</span> <span class="n">DiracDelta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">deltaintegrate</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">*</span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">*</span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">sin(1)*cos(1)*Heaviside(x - 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">deltaintegrate</span><span class="p">(</span><span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="n">z</span><span class="p">)</span><span class="o">*</span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">y</span> <span class="o">-</span> <span class="n">z</span><span class="p">),</span> <span class="n">y</span><span class="p">)</span>
<span class="go">z**2*DiracDelta(x - z)*Heaviside(y - z)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../functions/special.html#sympy.functions.special.delta_functions.DiracDelta" title="sympy.functions.special.delta_functions.DiracDelta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.special.delta_functions.DiracDelta</span></code></a>, <a class="reference internal" href="#sympy.integrals.integrals.Integral" title="sympy.integrals.integrals.Integral"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.Integral</span></code></a></p>
</div>
</dd></dl>

</li>
<li><p><a class="reference internal" href="#sympy.integrals.singularityfunctions.singularityintegrate" title="sympy.integrals.singularityfunctions.singularityintegrate"><code class="xref py py-func docutils literal notranslate"><span class="pre">singularityintegrate()</span></code></a> is applied if the function contains a <a class="reference internal" href="../functions/special.html#sympy.functions.special.singularity_functions.SingularityFunction" title="sympy.functions.special.singularity_functions.SingularityFunction"><code class="xref py py-class docutils literal notranslate"><span class="pre">SingularityFunction</span></code></a></p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.singularityfunctions.singularityintegrate">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.singularityfunctions.</span></span><span class="sig-name descname"><span class="pre">singularityintegrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/singularityfunctions.py#L6-L66"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.singularityfunctions.singularityintegrate" title="Permalink to this definition">¶</a></dt>
<dd><p>This function handles the indefinite integrations of Singularity functions.
The <code class="docutils literal notranslate"><span class="pre">integrate</span></code> function calls this function internally whenever an
instance of SingularityFunction is passed as argument.</p>
<p class="rubric">Explanation</p>
<p>The idea for integration is the following:</p>
<ul class="simple">
<li><p>If we are dealing with a SingularityFunction expression,
i.e. <code class="docutils literal notranslate"><span class="pre">SingularityFunction(x,</span> <span class="pre">a,</span> <span class="pre">n)</span></code>, we just return
<code class="docutils literal notranslate"><span class="pre">SingularityFunction(x,</span> <span class="pre">a,</span> <span class="pre">n</span> <span class="pre">+</span> <span class="pre">1)/(n</span> <span class="pre">+</span> <span class="pre">1)</span></code> if <code class="docutils literal notranslate"><span class="pre">n</span> <span class="pre">&gt;=</span> <span class="pre">0</span></code> and
<code class="docutils literal notranslate"><span class="pre">SingularityFunction(x,</span> <span class="pre">a,</span> <span class="pre">n</span> <span class="pre">+</span> <span class="pre">1)</span></code> if <code class="docutils literal notranslate"><span class="pre">n</span> <span class="pre">&lt;</span> <span class="pre">0</span></code>.</p></li>
<li><p>If the node is a multiplication or power node having a
SingularityFunction term we rewrite the whole expression in terms of
Heaviside and DiracDelta and then integrate the output. Lastly, we
rewrite the output of integration back in terms of SingularityFunction.</p></li>
<li><p>If none of the above case arises, we return None.</p></li>
</ul>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.singularityfunctions</span> <span class="kn">import</span> <span class="n">singularityintegrate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">SingularityFunction</span><span class="p">,</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">Function</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x a n y&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="n">Function</span><span class="p">(</span><span class="s1">&#39;f&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">singularityintegrate</span><span class="p">(</span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">SingularityFunction(x, a, 4)/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">singularityintegrate</span><span class="p">(</span><span class="mi">5</span><span class="o">*</span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">5*SingularityFunction(x, 5, -1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">singularityintegrate</span><span class="p">(</span><span class="mi">6</span><span class="o">*</span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">6*SingularityFunction(x, 5, 0)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">singularityintegrate</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">singularityintegrate</span><span class="p">(</span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">*</span> <span class="n">f</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">f(1)*SingularityFunction(x, 1, 0)</span>
</pre></div>
</div>
</dd></dl>

</li>
<li><p>If the heuristic algorithms cannot be applied, <a class="reference internal" href="#sympy.integrals.risch.risch_integrate" title="sympy.integrals.risch.risch_integrate"><code class="xref py py-func docutils literal notranslate"><span class="pre">risch_integrate()</span></code></a> is
tried next. The <em>Risch algorithm</em> is a general method for calculating
antiderivatives of elementary functions. The Risch algorithm is a decision
procedure that can determine whether an elementary solution exists, and in
that case calculate it. It can be extended to handle many nonelementary
functions in addition to the elementary ones. However, the version implemented
in SymPy only supports a small subset of the full algorithm, particularly, on
part of the transcendental algorithm for exponentials and logarithms is
implemented. An advantage of <a class="reference internal" href="#sympy.integrals.risch.risch_integrate" title="sympy.integrals.risch.risch_integrate"><code class="xref py py-func docutils literal notranslate"><span class="pre">risch_integrate()</span></code></a> over other methods is
that if it returns an instance of <a class="reference internal" href="#sympy.integrals.risch.NonElementaryIntegral" title="sympy.integrals.risch.NonElementaryIntegral"><code class="xref py py-class docutils literal notranslate"><span class="pre">NonElementaryIntegral</span></code></a>, the
integral is proven to be nonelementary by the algorithm, meaning the integral
cannot be represented using a combination of exponentials, logarithms, trig
functions, powers, rational functions, algebraic functions, and function
composition.</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.risch.risch_integrate">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.risch.</span></span><span class="sig-name descname"><span class="pre">risch_integrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">extension</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">handle_first</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'log'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">separate_integral</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rewrite_complex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">conds</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'piecewise'</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/risch.py#L1708-L1860"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.risch.risch_integrate" title="Permalink to this definition">¶</a></dt>
<dd><p>The Risch Integration Algorithm.</p>
<p class="rubric">Explanation</p>
<p>Only transcendental functions are supported.  Currently, only exponentials
and logarithms are supported, but support for trigonometric functions is
forthcoming.</p>
<p>If this function returns an unevaluated Integral in the result, it means
that it has proven that integral to be nonelementary.  Any errors will
result in raising NotImplementedError.  The unevaluated Integral will be
an instance of NonElementaryIntegral, a subclass of Integral.</p>
<p>handle_first may be either ‘exp’ or ‘log’.  This changes the order in
which the extension is built, and may result in a different (but
equivalent) solution (for an example of this, see issue 5109).  It is also
possible that the integral may be computed with one but not the other,
because not all cases have been implemented yet.  It defaults to ‘log’ so
that the outer extension is exponential when possible, because more of the
exponential case has been implemented.</p>
<p>If <code class="docutils literal notranslate"><span class="pre">separate_integral</span></code> is <code class="docutils literal notranslate"><span class="pre">True</span></code>, the result is returned as a tuple (ans, i),
where the integral is ans + i, ans is elementary, and i is either a
NonElementaryIntegral or 0.  This useful if you want to try further
integrating the NonElementaryIntegral part using other algorithms to
possibly get a solution in terms of special functions.  It is False by
default.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.risch</span> <span class="kn">import</span> <span class="n">risch_integrate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp</span><span class="p">,</span> <span class="n">log</span><span class="p">,</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<p>First, we try integrating exp(-x**2). Except for a constant factor of
2/sqrt(pi), this is the famous error function.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">risch_integrate</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">))</span>
<span class="go">  /</span>
<span class="go"> |</span>
<span class="go"> |    2</span>
<span class="go"> |  -x</span>
<span class="go"> | e    dx</span>
<span class="go"> |</span>
<span class="go">/</span>
</pre></div>
</div>
<p>The unevaluated Integral in the result means that risch_integrate() has
proven that exp(-x**2) does not have an elementary anti-derivative.</p>
<p>In many cases, risch_integrate() can split out the elementary
anti-derivative part from the nonelementary anti-derivative part.
For example,</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">risch_integrate</span><span class="p">((</span><span class="mi">2</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span>
<span class="gp">... </span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)),</span> <span class="n">x</span><span class="p">))</span>
<span class="go">                                         /</span>
<span class="go">                                        |</span>
<span class="go">  log(-x + log(x))   log(x + log(x))    |   1</span>
<span class="go">- ---------------- + --------------- +  | ------ dx</span>
<span class="go">         2                  2           | log(x)</span>
<span class="go">                                        |</span>
<span class="go">                                       /</span>
</pre></div>
</div>
<p>This means that it has proven that the integral of 1/log(x) is
nonelementary.  This function is also known as the logarithmic integral,
and is often denoted as Li(x).</p>
<p>risch_integrate() currently only accepts purely transcendental functions
with exponentials and logarithms, though note that this can include
nested exponentials and logarithms, as well as exponentials with bases
other than E.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">risch_integrate</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">*</span><span class="n">exp</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)),</span> <span class="n">x</span><span class="p">))</span>
<span class="go"> / x\</span>
<span class="go"> \e /</span>
<span class="go">e</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">risch_integrate</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)),</span> <span class="n">x</span><span class="p">))</span>
<span class="go">  /</span>
<span class="go"> |</span>
<span class="go"> |  / x\</span>
<span class="go"> |  \e /</span>
<span class="go"> | e     dx</span>
<span class="go"> |</span>
<span class="go">/</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">risch_integrate</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="n">x</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">+</span> <span class="n">x</span><span class="o">**</span><span class="n">x</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">))</span>
<span class="go">   x</span>
<span class="go">x*x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">risch_integrate</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">))</span>
<span class="go">  /</span>
<span class="go"> |</span>
<span class="go"> |  x</span>
<span class="go"> | x  dx</span>
<span class="go"> |</span>
<span class="go">/</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">risch_integrate</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="o">/</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">))</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">))</span>
<span class="go">     1</span>
<span class="go">-----------</span>
<span class="go">log(log(x))</span>
</pre></div>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.risch.NonElementaryIntegral">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.risch.</span></span><span class="sig-name descname"><span class="pre">NonElementaryIntegral</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">function</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">assumptions</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/risch.py#L1658-L1705"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.risch.NonElementaryIntegral" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents a nonelementary Integral.</p>
<p class="rubric">Explanation</p>
<p>If the result of integrate() is an instance of this class, it is
guaranteed to be nonelementary.  Note that integrate() by default will try
to find any closed-form solution, even in terms of special functions which
may themselves not be elementary.  To make integrate() only give
elementary solutions, or, in the cases where it can prove the integral to
be nonelementary, instances of this class, use integrate(risch=True).
In this case, integrate() may raise NotImplementedError if it cannot make
such a determination.</p>
<p>integrate() uses the deterministic Risch algorithm to integrate elementary
functions or prove that they have no elementary integral.  In some cases,
this algorithm can split an integral into an elementary and nonelementary
part, so that the result of integrate will be the sum of an elementary
expression and a NonElementaryIntegral.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">integrate</span><span class="p">,</span> <span class="n">exp</span><span class="p">,</span> <span class="n">log</span><span class="p">,</span> <span class="n">Integral</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">integrate</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="n">risch</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
<span class="go">Integral(exp(-x**2), x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
<span class="go">&lt;class &#39;sympy.integrals.risch.NonElementaryIntegral&#39;&gt;</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">expr</span> <span class="o">=</span> <span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">3</span> <span class="o">-</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">integrate</span><span class="p">(</span><span class="n">expr</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">risch</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">b</span><span class="p">)</span>
<span class="go">-log(-x + log(x))/2 + log(x + log(x))/2 + Integral(1/log(x), x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">type</span><span class="p">(</span><span class="n">b</span><span class="o">.</span><span class="n">atoms</span><span class="p">(</span><span class="n">Integral</span><span class="p">)</span><span class="o">.</span><span class="n">pop</span><span class="p">())</span>
<span class="go">&lt;class &#39;sympy.integrals.risch.NonElementaryIntegral&#39;&gt;</span>
</pre></div>
</div>
</dd></dl>

</li>
<li><p>For non-elementary definite integrals, SymPy uses so-called Meijer G-functions.
Details are described in <a class="reference internal" href="g-functions.html#g-functions"><span class="std std-ref">Computing Integrals using Meijer G-Functions</span></a>.</p></li>
<li><p>All the algorithms mentioned thus far are either pattern-matching based
heuristic, or solve integrals using algorithms that are much different from
the way most people are taught in their calculus courses. SymPy also
implements a method that can solve integrals in much the same way you would in
calculus. The advantage of this method is that it is possible to extract the
integration steps from, so that one can see how to compute the integral “by
hand”. This is used by <a class="reference external" href="https://sympygamma.com/">SymPy Gamma</a>. This is
implemented in the <a class="reference internal" href="#sympy.integrals.manualintegrate.manualintegrate" title="sympy.integrals.manualintegrate.manualintegrate"><code class="xref py py-func docutils literal notranslate"><span class="pre">manualintegrate()</span></code></a> function. The steps for an integral
can be seen with the <a class="reference internal" href="#sympy.integrals.manualintegrate.integral_steps" title="sympy.integrals.manualintegrate.integral_steps"><code class="xref py py-func docutils literal notranslate"><span class="pre">integral_steps()</span></code></a> function.</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.manualintegrate.manualintegrate">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.manualintegrate.</span></span><span class="sig-name descname"><span class="pre">manualintegrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">var</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/manualintegrate.py#L1612-L1671"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.manualintegrate.manualintegrate" title="Permalink to this definition">¶</a></dt>
<dd><p class="rubric">Explanation</p>
<p>Compute indefinite integral of a single variable using an algorithm that
resembles what a student would do by hand.</p>
<p>Unlike <a class="reference internal" href="#sympy.integrals.integrals.integrate" title="sympy.integrals.integrals.integrate"><code class="xref py py-func docutils literal notranslate"><span class="pre">integrate()</span></code></a>, var can only be a single symbol.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sin</span><span class="p">,</span> <span class="n">cos</span><span class="p">,</span> <span class="n">tan</span><span class="p">,</span> <span class="n">exp</span><span class="p">,</span> <span class="n">log</span><span class="p">,</span> <span class="n">integrate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.manualintegrate</span> <span class="kn">import</span> <span class="n">manualintegrate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">manualintegrate</span><span class="p">(</span><span class="mi">1</span> <span class="o">/</span> <span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">log(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="n">x</span><span class="p">)</span>
<span class="go">log(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">manualintegrate</span><span class="p">(</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x*log(x) - x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">x*log(x) - x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">manualintegrate</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">exp</span><span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">x</span><span class="p">)),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">atan(exp(x))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">exp</span><span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">x</span><span class="p">)))</span>
<span class="go">RootSum(4*_z**2 + 1, Lambda(_i, _i*log(2*_i + exp(x))))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">manualintegrate</span><span class="p">(</span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">4</span> <span class="o">*</span> <span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-cos(x)**5/5</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">4</span> <span class="o">*</span> <span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-cos(x)**5/5</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">manualintegrate</span><span class="p">(</span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">4</span> <span class="o">*</span> <span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">3</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">cos(x)**7/7 - cos(x)**5/5</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">4</span> <span class="o">*</span> <span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">3</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">cos(x)**7/7 - cos(x)**5/5</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">manualintegrate</span><span class="p">(</span><span class="n">tan</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-log(cos(x))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">tan</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-log(cos(x))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.integrals.integrate" title="sympy.integrals.integrals.integrate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.integrate</span></code></a>, <a class="reference internal" href="#sympy.integrals.integrals.Integral.doit" title="sympy.integrals.integrals.Integral.doit"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.Integral.doit</span></code></a>, <a class="reference internal" href="#sympy.integrals.integrals.Integral" title="sympy.integrals.integrals.Integral"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.Integral</span></code></a></p>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.manualintegrate.integral_steps">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.manualintegrate.</span></span><span class="sig-name descname"><span class="pre">integral_steps</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">integrand</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">symbol</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">options</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/manualintegrate.py#L1205-L1335"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.manualintegrate.integral_steps" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the steps needed to compute an integral.</p>
<dl class="field-list">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><strong>rule</strong> : namedtuple</p>
<blockquote>
<div><p>The first step; most rules have substeps that must also be
considered. These substeps can be evaluated using <code class="docutils literal notranslate"><span class="pre">manualintegrate</span></code>
to obtain a result.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>This function attempts to mirror what a student would do by hand as
closely as possible.</p>
<p>SymPy Gamma uses this to provide a step-by-step explanation of an
integral. The code it uses to format the results of this function can be
found at
<a class="reference external" href="https://github.com/sympy/sympy_gamma/blob/master/app/logic/intsteps.py">https://github.com/sympy/sympy_gamma/blob/master/app/logic/intsteps.py</a>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp</span><span class="p">,</span> <span class="n">sin</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.manualintegrate</span> <span class="kn">import</span> <span class="n">integral_steps</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="nb">repr</span><span class="p">(</span><span class="n">integral_steps</span><span class="p">(</span><span class="n">exp</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">exp</span><span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">x</span><span class="p">)),</span> <span class="n">x</span><span class="p">)))</span>     
<span class="go">URule(u_var=_u, u_func=exp(x), constant=1,</span>
<span class="go">substep=PiecewiseRule(subfunctions=[(ArctanRule(a=1, b=1, c=1, context=1/(_u**2 + 1), symbol=_u), True),</span>
<span class="go">    (ArccothRule(a=1, b=1, c=1, context=1/(_u**2 + 1), symbol=_u), False),</span>
<span class="go">    (ArctanhRule(a=1, b=1, c=1, context=1/(_u**2 + 1), symbol=_u), False)],</span>
<span class="go">context=1/(_u**2 + 1), symbol=_u), context=exp(x)/(exp(2*x) + 1), symbol=x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="nb">repr</span><span class="p">(</span><span class="n">integral_steps</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)))</span>     
<span class="go">TrigRule(func=&#39;sin&#39;, arg=x, context=sin(x), symbol=x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="nb">repr</span><span class="p">(</span><span class="n">integral_steps</span><span class="p">((</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span> <span class="p">,</span> <span class="n">x</span><span class="p">)))</span>     
<span class="go">RewriteRule(rewritten=x**4 + 6*x**2 + 9,</span>
<span class="go">substep=AddRule(substeps=[PowerRule(base=x, exp=4, context=x**4, symbol=x),</span>
<span class="go">    ConstantTimesRule(constant=6, other=x**2,</span>
<span class="go">        substep=PowerRule(base=x, exp=2, context=x**2, symbol=x),</span>
<span class="go">            context=6*x**2, symbol=x),</span>
<span class="go">    ConstantRule(constant=9, context=9, symbol=x)],</span>
<span class="go">context=x**4 + 6*x**2 + 9, symbol=x), context=(x**2 + 3)**2, symbol=x)</span>
</pre></div>
</div>
</dd></dl>

</li>
<li><p>Finally, if all the above fail, SymPy also uses a simplified version of the
Risch algorithm, called the <em>Risch-Norman algorithm</em>. This algorithm is tried
last because it is often the slowest to compute. This is implemented in
<a class="reference internal" href="#sympy.integrals.heurisch.heurisch" title="sympy.integrals.heurisch.heurisch"><code class="xref py py-func docutils literal notranslate"><span class="pre">heurisch()</span></code></a>:</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.heurisch.heurisch">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.heurisch.</span></span><span class="sig-name descname"><span class="pre">heurisch</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rewrite</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">hints</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mappings</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">retries</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">3</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">degree_offset</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">unnecessary_permutations</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">_try_heurisch</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/heurisch.py#L290-L759"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.heurisch.heurisch" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute indefinite integral using heuristic Risch algorithm.</p>
<p class="rubric">Explanation</p>
<p>This is a heuristic approach to indefinite integration in finite
terms using the extended heuristic (parallel) Risch algorithm, based
on Manuel Bronstein’s “Poor Man’s Integrator”.</p>
<p>The algorithm supports various classes of functions including
transcendental elementary or special functions like Airy,
Bessel, Whittaker and Lambert.</p>
<p>Note that this algorithm is not a decision procedure. If it isn’t
able to compute the antiderivative for a given function, then this is
not a proof that such a functions does not exist.  One should use
recursive Risch algorithm in such case.  It’s an open question if
this algorithm can be made a full decision procedure.</p>
<p>This is an internal integrator procedure. You should use toplevel
‘integrate’ function in most cases,  as this procedure needs some
preprocessing steps and otherwise may fail.</p>
<p class="rubric">Specification</p>
<p>heurisch(f, x, rewrite=False, hints=None)</p>
<blockquote>
<div><dl>
<dt>where</dt><dd><p>f : expression
x : symbol</p>
<p>rewrite -&gt; force rewrite ‘f’ in terms of ‘tan’ and ‘tanh’
hints   -&gt; a list of functions that may appear in anti-derivate</p>
<blockquote>
<div><ul class="simple">
<li><p>hints = None          –&gt; no suggestions at all</p></li>
<li><p>hints = [ ]           –&gt; try to figure out</p></li>
<li><p>hints = [f1, …, fn] –&gt; we know better</p></li>
</ul>
</div></blockquote>
</dd>
</dl>
</div></blockquote>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">tan</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.heurisch</span> <span class="kn">import</span> <span class="n">heurisch</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">heurisch</span><span class="p">(</span><span class="n">y</span><span class="o">*</span><span class="n">tan</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">y*log(tan(x)**2 + 1)/2</span>
</pre></div>
</div>
<p>See Manuel Bronstein’s “Poor Man’s Integrator”:</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.integrals.Integral.doit" title="sympy.integrals.integrals.Integral.doit"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.Integral.doit</span></code></a>, <a class="reference internal" href="#sympy.integrals.integrals.Integral" title="sympy.integrals.integrals.Integral"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.Integral</span></code></a>, <a class="reference internal" href="#sympy.integrals.heurisch.components" title="sympy.integrals.heurisch.components"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.heurisch.components</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r491"><span class="brackets"><a class="fn-backref" href="#id3">R491</a></span></dt>
<dd><p><a class="reference external" href="http://www-sop.inria.fr/cafe/Manuel.Bronstein/pmint/index.html">http://www-sop.inria.fr/cafe/Manuel.Bronstein/pmint/index.html</a></p>
</dd>
</dl>
<p>For more information on the implemented algorithm refer to:</p>
<dl class="citation">
<dt class="label" id="r492"><span class="brackets"><a class="fn-backref" href="#id4">R492</a></span></dt>
<dd><p>K. Geddes, L. Stefanus, On the Risch-Norman Integration
Method and its Implementation in Maple, Proceedings of
ISSAC’89, ACM Press, 212-217.</p>
</dd>
<dt class="label" id="r493"><span class="brackets"><a class="fn-backref" href="#id5">R493</a></span></dt>
<dd><p>J. H. Davenport, On the Parallel Risch Algorithm (I),
Proceedings of EUROCAM’82, LNCS 144, Springer, 144-157.</p>
</dd>
<dt class="label" id="r494"><span class="brackets"><a class="fn-backref" href="#id6">R494</a></span></dt>
<dd><p>J. H. Davenport, On the Parallel Risch Algorithm (III):
Use of Tangents, SIGSAM Bulletin 16 (1982), 3-6.</p>
</dd>
<dt class="label" id="r495"><span class="brackets"><a class="fn-backref" href="#id7">R495</a></span></dt>
<dd><p>J. H. Davenport, B. M. Trager, On the Parallel Risch
Algorithm (II), ACM Transactions on Mathematical
Software 11 (1985), 356-362.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.heurisch.components">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.heurisch.</span></span><span class="sig-name descname"><span class="pre">components</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/heurisch.py#L43-L87"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.heurisch.components" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a set of all functional components of the given expression
which includes symbols, function applications and compositions and
non-integer powers. Fractional powers are collected with
minimal, positive exponents.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">cos</span><span class="p">,</span> <span class="n">sin</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.heurisch</span> <span class="kn">import</span> <span class="n">components</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">components</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">*</span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">{x, sin(x), cos(x)}</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.heurisch.heurisch" title="sympy.integrals.heurisch.heurisch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">heurisch</span></code></a></p>
</div>
</dd></dl>

</li>
</ol>
</section>
<section id="api-reference">
<h2>API reference<a class="headerlink" href="#api-reference" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.integrals.integrate">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.integrals.</span></span><span class="sig-name descname"><span class="pre">integrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">f</span></em>, <em class="sig-param"><span class="pre">var</span></em>, <em class="sig-param"><span class="pre">...</span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/integrals.py#L1389-L1556"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.integrals.integrate" title="Permalink to this definition">¶</a></dt>
<dd><p class="rubric">Explanation</p>
<p>Compute definite or indefinite integral of one or more variables
using Risch-Norman algorithm and table lookup. This procedure is
able to handle elementary algebraic and transcendental functions
and also a huge class of special functions, including Airy,
Bessel, Whittaker and Lambert.</p>
<p>var can be:</p>
<ul class="simple">
<li><p>a symbol                   – indefinite integration</p></li>
<li><dl class="simple">
<dt>a tuple (symbol, a)        – indefinite integration with result</dt><dd><p>given with <span class="math notranslate nohighlight">\(a\)</span> replacing <span class="math notranslate nohighlight">\(symbol\)</span></p>
</dd>
</dl>
</li>
<li><p>a tuple (symbol, a, b)     – definite integration</p></li>
</ul>
<p>Several variables can be specified, in which case the result is
multiple integration. (If var is omitted and the integrand is
univariate, the indefinite integral in that variable will be performed.)</p>
<p>Indefinite integrals are returned without terms that are independent
of the integration variables. (see examples)</p>
<p>Definite improper integrals often entail delicate convergence
conditions. Pass conds=’piecewise’, ‘separate’ or ‘none’ to have
these returned, respectively, as a Piecewise function, as a separate
result (i.e. result will be a tuple), or not at all (default is
‘piecewise’).</p>
<p><strong>Strategy</strong></p>
<p>SymPy uses various approaches to definite integration. One method is to
find an antiderivative for the integrand, and then use the fundamental
theorem of calculus. Various functions are implemented to integrate
polynomial, rational and trigonometric functions, and integrands
containing DiracDelta terms.</p>
<p>SymPy also implements the part of the Risch algorithm, which is a decision
procedure for integrating elementary functions, i.e., the algorithm can
either find an elementary antiderivative, or prove that one does not
exist.  There is also a (very successful, albeit somewhat slow) general
implementation of the heuristic Risch algorithm.  This algorithm will
eventually be phased out as more of the full Risch algorithm is
implemented. See the docstring of Integral._eval_integral() for more
details on computing the antiderivative using algebraic methods.</p>
<p>The option risch=True can be used to use only the (full) Risch algorithm.
This is useful if you want to know if an elementary function has an
elementary antiderivative.  If the indefinite Integral returned by this
function is an instance of NonElementaryIntegral, that means that the
Risch algorithm has proven that integral to be non-elementary.  Note that
by default, additional methods (such as the Meijer G method outlined
below) are tried on these integrals, as they may be expressible in terms
of special functions, so if you only care about elementary answers, use
risch=True.  Also note that an unevaluated Integral returned by this
function is not necessarily a NonElementaryIntegral, even with risch=True,
as it may just be an indication that the particular part of the Risch
algorithm needed to integrate that function is not yet implemented.</p>
<p>Another family of strategies comes from re-writing the integrand in
terms of so-called Meijer G-functions. Indefinite integrals of a
single G-function can always be computed, and the definite integral
of a product of two G-functions can be computed from zero to
infinity. Various strategies are implemented to rewrite integrands
as G-functions, and use this information to compute integrals (see
the <code class="docutils literal notranslate"><span class="pre">meijerint</span></code> module).</p>
<p>The option manual=True can be used to use only an algorithm that tries
to mimic integration by hand. This algorithm does not handle as many
integrands as the other algorithms implemented but may return results in
a more familiar form. The <code class="docutils literal notranslate"><span class="pre">manualintegrate</span></code> module has functions that
return the steps used (see the module docstring for more information).</p>
<p>In general, the algebraic methods work best for computing
antiderivatives of (possibly complicated) combinations of elementary
functions. The G-function methods work best for computing definite
integrals from zero to infinity of moderately complicated
combinations of special functions, or indefinite integrals of very
simple combinations of special functions.</p>
<p>The strategy employed by the integration code is as follows:</p>
<ul class="simple">
<li><p>If computing a definite integral, and both limits are real,
and at least one limit is +- oo, try the G-function method of
definite integration first.</p></li>
<li><p>Try to find an antiderivative, using all available methods, ordered
by performance (that is try fastest method first, slowest last; in
particular polynomial integration is tried first, Meijer
G-functions second to last, and heuristic Risch last).</p></li>
<li><p>If still not successful, try G-functions irrespective of the
limits.</p></li>
</ul>
<p>The option meijerg=True, False, None can be used to, respectively:
always use G-function methods and no others, never use G-function
methods, or use all available methods (in order as described above).
It defaults to None.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">integrate</span><span class="p">,</span> <span class="n">log</span><span class="p">,</span> <span class="n">exp</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x**2*y/2</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x*log(x) - x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">log</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">a</span><span class="p">))</span>
<span class="go">a*log(a) - a + 1</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">x**2/2</span>
</pre></div>
</div>
<p>Terms that are independent of x are dropped by indefinite integration:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sqrt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">x</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">))</span>
<span class="go">2*(x + 1)**(3/2)/3 - 2/3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">2*(x + 1)**(3/2)/3</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">)</span>
<span class="gt">Traceback (most recent call last):</span>
<span class="c">...</span>
<span class="gr">ValueError</span>: <span class="n">specify integration variables to integrate x*y</span>
</pre></div>
</div>
<p>Note that <code class="docutils literal notranslate"><span class="pre">integrate(x)</span></code> syntax is meant only for convenience
in interactive sessions and should be avoided in library code.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="n">a</span><span class="o">*</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">))</span> <span class="c1"># same as conds=&#39;piecewise&#39;</span>
<span class="go">Piecewise((gamma(a + 1), re(a) &gt; -1),</span>
<span class="go">    (Integral(x**a*exp(-x), (x, 0, oo)), True))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="n">a</span><span class="o">*</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">),</span> <span class="n">conds</span><span class="o">=</span><span class="s1">&#39;none&#39;</span><span class="p">)</span>
<span class="go">gamma(a + 1)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="n">a</span><span class="o">*</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">),</span> <span class="n">conds</span><span class="o">=</span><span class="s1">&#39;separate&#39;</span><span class="p">)</span>
<span class="go">(gamma(a + 1), -re(a) &lt; 1)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.integrals.Integral" title="sympy.integrals.integrals.Integral"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Integral</span></code></a>, <a class="reference internal" href="#sympy.integrals.integrals.Integral.doit" title="sympy.integrals.integrals.Integral.doit"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Integral.doit</span></code></a></p>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.integrals.line_integrate">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.integrals.</span></span><span class="sig-name descname"><span class="pre">line_integrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">field</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Curve</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">variables</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/integrals.py#L1559-L1606"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.integrals.line_integrate" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the line integral.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Curve</span><span class="p">,</span> <span class="n">line_integrate</span><span class="p">,</span> <span class="n">E</span><span class="p">,</span> <span class="n">ln</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">t</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">C</span> <span class="o">=</span> <span class="n">Curve</span><span class="p">([</span><span class="n">E</span><span class="o">**</span><span class="n">t</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">E</span><span class="o">**</span><span class="n">t</span> <span class="o">-</span> <span class="mi">1</span><span class="p">],</span> <span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">ln</span><span class="p">(</span><span class="mi">2</span><span class="p">)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">line_integrate</span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="n">y</span><span class="p">,</span> <span class="n">C</span><span class="p">,</span> <span class="p">[</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">])</span>
<span class="go">3*sqrt(2)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.integrals.integrate" title="sympy.integrals.integrals.integrate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.integrate</span></code></a>, <a class="reference internal" href="#sympy.integrals.integrals.Integral" title="sympy.integrals.integrals.Integral"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Integral</span></code></a></p>
</div>
</dd></dl>

<p>The class <a class="reference internal" href="#sympy.integrals.integrals.Integral" title="sympy.integrals.integrals.Integral"><code class="xref py py-class docutils literal notranslate"><span class="pre">Integral</span></code></a> represents an unevaluated integral and has some methods that help in the integration of an expression.</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.integrals.integrals.Integral">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.integrals.integrals.</span></span><span class="sig-name descname"><span class="pre">Integral</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">function</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">assumptions</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/integrals.py#L34-L1385"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.integrals.Integral" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents unevaluated integral.</p>
<dl class="py data">
<dt class="sig sig-object py" id="sympy.integrals.integrals.Integral.is_commutative">
<span class="sig-name descname"><span class="pre">is_commutative</span></span><a class="headerlink" href="#sympy.integrals.integrals.Integral.is_commutative" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns whether all the free symbols in the integral are commutative.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.integrals.integrals.Integral.as_sum">
<span class="sig-name descname"><span class="pre">as_sum</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">method</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'midpoint'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">evaluate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/integrals.py#L1185-L1324"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.integrals.Integral.as_sum" title="Permalink to this definition">¶</a></dt>
<dd><p>Approximates a definite integral by a sum.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n :</strong></p>
<blockquote>
<div><p>The number of subintervals to use, optional.</p>
</div></blockquote>
<p><strong>method :</strong></p>
<blockquote>
<div><p>One of: ‘left’, ‘right’, ‘midpoint’, ‘trapezoid’.</p>
</div></blockquote>
<p><strong>evaluate</strong> : bool</p>
<blockquote>
<div><p>If False, returns an unevaluated Sum expression. The default
is True, evaluate the sum.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>These methods of approximate integration are described in [1].</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sin</span><span class="p">,</span> <span class="n">sqrt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals</span> <span class="kn">import</span> <span class="n">Integral</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">e</span> <span class="o">=</span> <span class="n">Integral</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">7</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">e</span>
<span class="go">Integral(sin(x), (x, 3, 7))</span>
</pre></div>
</div>
<p>For demonstration purposes, this interval will only be split into 2
regions, bounded by [3, 5] and [5, 7].</p>
<p>The left-hand rule uses function evaluations at the left of each
interval:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="s1">&#39;left&#39;</span><span class="p">)</span>
<span class="go">2*sin(5) + 2*sin(3)</span>
</pre></div>
</div>
<p>The midpoint rule uses evaluations at the center of each interval:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="s1">&#39;midpoint&#39;</span><span class="p">)</span>
<span class="go">2*sin(4) + 2*sin(6)</span>
</pre></div>
</div>
<p>The right-hand rule uses function evaluations at the right of each
interval:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="s1">&#39;right&#39;</span><span class="p">)</span>
<span class="go">2*sin(5) + 2*sin(7)</span>
</pre></div>
</div>
<p>The trapezoid rule uses function evaluations on both sides of the
intervals. This is equivalent to taking the average of the left and
right hand rule results:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="s1">&#39;trapezoid&#39;</span><span class="p">)</span>
<span class="go">2*sin(5) + sin(3) + sin(7)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="s1">&#39;left&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="s1">&#39;right&#39;</span><span class="p">))</span><span class="o">/</span><span class="mi">2</span> <span class="o">==</span> <span class="n">_</span>
<span class="go">True</span>
</pre></div>
</div>
<p>Here, the discontinuity at x = 0 can be avoided by using the
midpoint or right-hand method:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">e</span> <span class="o">=</span> <span class="n">Integral</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span><span class="o">.</span><span class="n">n</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
<span class="go">1.730</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span><span class="o">.</span><span class="n">n</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
<span class="go">1.809</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span><span class="o">.</span><span class="n">n</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>  <span class="c1"># the actual value is 2</span>
<span class="go">2.000</span>
</pre></div>
</div>
<p>The left- or trapezoid method will encounter the discontinuity and
return infinity:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="s1">&#39;left&#39;</span><span class="p">)</span>
<span class="go">zoo</span>
</pre></div>
</div>
<p>The number of intervals can be symbolic. If omitted, a dummy symbol
will be used for it.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">e</span> <span class="o">=</span> <span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="s1">&#39;right&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">()</span>
<span class="go">8/3 + 4/n + 4/(3*n**2)</span>
</pre></div>
</div>
<p>This shows that the midpoint rule is more accurate, as its error
term decays as the square of n:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="n">method</span><span class="o">=</span><span class="s1">&#39;midpoint&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">()</span>
<span class="go">8/3 - 2/(3*_n**2)</span>
</pre></div>
</div>
<p>A symbolic sum is returned with evaluate=False:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">e</span><span class="o">.</span><span class="n">as_sum</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="s1">&#39;midpoint&#39;</span><span class="p">,</span> <span class="n">evaluate</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">2*Sum((2*_k/n - 1/n)**2, (_k, 1, n))/n</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.integrals.integrals.Integral.doit" title="sympy.integrals.integrals.Integral.doit"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Integral.doit</span></code></a></dt><dd><p>Perform the integration using any hints</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r496"><span class="brackets"><a class="fn-backref" href="#id8">R496</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Riemann_sum#Methods">https://en.wikipedia.org/wiki/Riemann_sum#Methods</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.integrals.integrals.Integral.doit">
<span class="sig-name descname"><span class="pre">doit</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">hints</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/integrals.py#L376-L706"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.integrals.Integral.doit" title="Permalink to this definition">¶</a></dt>
<dd><p>Perform the integration using any hints given.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Piecewise</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">t</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">Piecewise</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="o">/</span><span class="n">t</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="kc">True</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span><span class="o">.</span><span class="n">integrate</span><span class="p">((</span><span class="n">t</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span><span class="o">/</span><span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="go">1/3</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.trigonometry.trigintegrate" title="sympy.integrals.trigonometry.trigintegrate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.trigonometry.trigintegrate</span></code></a>, <a class="reference internal" href="#sympy.integrals.heurisch.heurisch" title="sympy.integrals.heurisch.heurisch"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.heurisch.heurisch</span></code></a>, <a class="reference internal" href="#sympy.integrals.rationaltools.ratint" title="sympy.integrals.rationaltools.ratint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.rationaltools.ratint</span></code></a></p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.integrals.integrals.Integral.as_sum" title="sympy.integrals.integrals.Integral.as_sum"><code class="xref py py-obj docutils literal notranslate"><span class="pre">as_sum</span></code></a></dt><dd><p>Approximate the integral using a sum</p>
</dd>
</dl>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.integrals.integrals.Integral.free_symbols">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">free_symbols</span></span><a class="headerlink" href="#sympy.integrals.integrals.Integral.free_symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>This method returns the symbols that will exist when the
integral is evaluated. This is useful if one is trying to
determine whether an integral depends on a certain
symbol or not.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Integral</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">free_symbols</span>
<span class="go">{y}</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.function" title="sympy.concrete.expr_with_limits.ExprWithLimits.function"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.concrete.expr_with_limits.ExprWithLimits.function</span></code></a>, <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.limits" title="sympy.concrete.expr_with_limits.ExprWithLimits.limits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.concrete.expr_with_limits.ExprWithLimits.limits</span></code></a>, <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.variables" title="sympy.concrete.expr_with_limits.ExprWithLimits.variables"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.concrete.expr_with_limits.ExprWithLimits.variables</span></code></a></p>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.integrals.integrals.Integral.principal_value">
<span class="sig-name descname"><span class="pre">principal_value</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/integrals.py#L1326-L1385"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.integrals.Integral.principal_value" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the Cauchy Principal Value of the definite integral of a real function in the given interval
on the real axis.</p>
<p class="rubric">Explanation</p>
<p>In mathematics, the Cauchy principal value, is a method for assigning values to certain improper
integrals which would otherwise be undefined.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.integrals</span> <span class="kn">import</span> <span class="n">Integral</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="n">oo</span><span class="p">,</span> <span class="n">oo</span><span class="p">))</span><span class="o">.</span><span class="n">principal_value</span><span class="p">()</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">/</span> <span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="n">oo</span><span class="p">,</span> <span class="n">oo</span><span class="p">))</span><span class="o">.</span><span class="n">principal_value</span><span class="p">()</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span><span class="o">.</span><span class="n">principal_value</span><span class="p">()</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="mi">10</span><span class="p">,</span> <span class="n">oo</span><span class="p">))</span><span class="o">.</span><span class="n">principal_value</span><span class="p">()</span> <span class="o">+</span> <span class="n">Integral</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="n">oo</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span><span class="o">.</span><span class="n">principal_value</span><span class="p">()</span>
<span class="go">0</span>
</pre></div>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r497"><span class="brackets"><a class="fn-backref" href="#id9">R497</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Cauchy_principal_value">https://en.wikipedia.org/wiki/Cauchy_principal_value</a></p>
</dd>
<dt class="label" id="r498"><span class="brackets"><a class="fn-backref" href="#id10">R498</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/CauchyPrincipalValue.html">http://mathworld.wolfram.com/CauchyPrincipalValue.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.integrals.integrals.Integral.transform">
<span class="sig-name descname"><span class="pre">transform</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">u</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/integrals.py#L157-L374"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.integrals.Integral.transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Performs a change of variables from <span class="math notranslate nohighlight">\(x\)</span> to <span class="math notranslate nohighlight">\(u\)</span> using the relationship
given by <span class="math notranslate nohighlight">\(x\)</span> and <span class="math notranslate nohighlight">\(u\)</span> which will define the transformations <span class="math notranslate nohighlight">\(f\)</span> and <span class="math notranslate nohighlight">\(F\)</span>
(which are inverses of each other) as follows:</p>
<ol class="arabic simple">
<li><p>If <span class="math notranslate nohighlight">\(x\)</span> is a Symbol (which is a variable of integration) then <span class="math notranslate nohighlight">\(u\)</span>
will be interpreted as some function, f(u), with inverse F(u).
This, in effect, just makes the substitution of x with f(x).</p></li>
<li><p>If <span class="math notranslate nohighlight">\(u\)</span> is a Symbol then <span class="math notranslate nohighlight">\(x\)</span> will be interpreted as some function,
F(x), with inverse f(u). This is commonly referred to as
u-substitution.</p></li>
</ol>
<p>Once f and F have been identified, the transformation is made as
follows:</p>
<div class="math notranslate nohighlight">
\[\int_a^b x \mathrm{d}x \rightarrow \int_{F(a)}^{F(b)} f(x)
\frac{\mathrm{d}}{\mathrm{d}x}\]</div>
<p>where <span class="math notranslate nohighlight">\(F(x)\)</span> is the inverse of <span class="math notranslate nohighlight">\(f(x)\)</span> and the limits and integrand have
been corrected so as to retain the same value after integration.</p>
<p class="rubric">Notes</p>
<p>The mappings, F(x) or f(u), must lead to a unique integral. Linear
or rational linear expression, <code class="docutils literal notranslate"><span class="pre">2*x</span></code>, <code class="docutils literal notranslate"><span class="pre">1/x</span></code> and <code class="docutils literal notranslate"><span class="pre">sqrt(x)</span></code>, will
always work; quadratic expressions like <code class="docutils literal notranslate"><span class="pre">x**2</span> <span class="pre">-</span> <span class="pre">1</span></code> are acceptable
as long as the resulting integrand does not depend on the sign of
the solutions (see examples).</p>
<p>The integral will be returned unchanged if <code class="docutils literal notranslate"><span class="pre">x</span></code> is not a variable of
integration.</p>
<p><code class="docutils literal notranslate"><span class="pre">x</span></code> must be (or contain) only one of of the integration variables. If
<code class="docutils literal notranslate"><span class="pre">u</span></code> has more than one free symbol then it should be sent as a tuple
(<code class="docutils literal notranslate"><span class="pre">u</span></code>, <code class="docutils literal notranslate"><span class="pre">uvar</span></code>) where <code class="docutils literal notranslate"><span class="pre">uvar</span></code> identifies which variable is replacing
the integration variable.
XXX can it contain another integration variable?</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">u</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Integral</span><span class="p">,</span> <span class="n">cos</span><span class="p">,</span> <span class="n">sqrt</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">i</span> <span class="o">=</span> <span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
</pre></div>
</div>
<p>transform can change the variable of integration</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">i</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">u</span><span class="p">)</span>
<span class="go">Integral(u*cos(u**2 - 1), (u, 0, 1))</span>
</pre></div>
</div>
<p>transform can perform u-substitution as long as a unique
integrand is obtained:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">i</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">u</span><span class="p">)</span>
<span class="go">Integral(cos(u)/2, (u, -1, 0))</span>
</pre></div>
</div>
<p>This attempt fails because x = +/-sqrt(u + 1) and the
sign does not cancel out of the integrand:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="n">u</span><span class="p">)</span>
<span class="gt">Traceback (most recent call last):</span>
<span class="c">...</span>
<span class="gr">ValueError</span>:
<span class="go">The mapping between F(x) and f(u) did not give a unique integrand.</span>
</pre></div>
</div>
<p>transform can do a substitution. Here, the previous
result is transformed back into the original expression
using “u-substitution”:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ui</span> <span class="o">=</span> <span class="n">_</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">_</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="n">u</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span> <span class="o">==</span> <span class="n">i</span>
<span class="go">True</span>
</pre></div>
</div>
<p>We can accomplish the same with a regular substitution:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ui</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">u</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">==</span> <span class="n">i</span>
<span class="go">True</span>
</pre></div>
</div>
<p>If the <span class="math notranslate nohighlight">\(x\)</span> does not contain a symbol of integration then
the integral will be returned unchanged. Integral <span class="math notranslate nohighlight">\(i\)</span> does
not have an integration variable <span class="math notranslate nohighlight">\(a\)</span> so no change is made:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">i</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span> <span class="o">==</span> <span class="n">i</span>
<span class="go">True</span>
</pre></div>
</div>
<p>When <span class="math notranslate nohighlight">\(u\)</span> has more than one free symbol the symbol that is
replacing <span class="math notranslate nohighlight">\(x\)</span> must be identified by passing <span class="math notranslate nohighlight">\(u\)</span> as a tuple:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">u</span> <span class="o">+</span> <span class="n">a</span><span class="p">,</span> <span class="n">u</span><span class="p">))</span>
<span class="go">Integral(a + u, (u, -a, 1 - a))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">u</span> <span class="o">+</span> <span class="n">a</span><span class="p">,</span> <span class="n">a</span><span class="p">))</span>
<span class="go">Integral(a + u, (a, -u, 1 - u))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.variables" title="sympy.concrete.expr_with_limits.ExprWithLimits.variables"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.concrete.expr_with_limits.ExprWithLimits.variables</span></code></a></dt><dd><p>Lists the integration variables</p>
</dd>
<dt><a class="reference internal" href="../core.html#sympy.core.basic.Basic.as_dummy" title="sympy.core.basic.Basic.as_dummy"><code class="xref py py-obj docutils literal notranslate"><span class="pre">as_dummy</span></code></a></dt><dd><p>Replace integration variables with dummy ones</p>
</dd>
</dl>
</div>
</dd></dl>

</dd></dl>

<p><a class="reference internal" href="#sympy.integrals.integrals.Integral" title="sympy.integrals.integrals.Integral"><code class="xref py py-class docutils literal notranslate"><span class="pre">Integral</span></code></a> subclasses from <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits" title="sympy.concrete.expr_with_limits.ExprWithLimits"><code class="xref py py-class docutils literal notranslate"><span class="pre">ExprWithLimits</span></code></a>, which is a
common superclass of <a class="reference internal" href="#sympy.integrals.integrals.Integral" title="sympy.integrals.integrals.Integral"><code class="xref py py-class docutils literal notranslate"><span class="pre">Integral</span></code></a> and <a class="reference internal" href="../concrete.html#sympy.concrete.summations.Sum" title="sympy.concrete.summations.Sum"><code class="xref py py-class docutils literal notranslate"><span class="pre">Sum</span></code></a>.</p>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.concrete.expr_with_limits.ExprWithLimits">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.concrete.expr_with_limits.</span></span><span class="sig-name descname"><span class="pre">ExprWithLimits</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">function</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">symbols</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">assumptions</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/concrete/expr_with_limits.py#L161-L489"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.concrete.expr_with_limits.ExprWithLimits" title="Permalink to this definition">¶</a></dt>
<dd><dl class="py property">
<dt class="sig sig-object py" id="sympy.concrete.expr_with_limits.ExprWithLimits.bound_symbols">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">bound_symbols</span></span><a class="headerlink" href="#sympy.concrete.expr_with_limits.ExprWithLimits.bound_symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>Return only variables that are dummy variables.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Integral</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">,</span> <span class="n">k</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="n">i</span><span class="p">,</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="n">j</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="n">k</span><span class="p">)</span><span class="o">.</span><span class="n">bound_symbols</span>
<span class="go">[i, j]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.function" title="sympy.concrete.expr_with_limits.ExprWithLimits.function"><code class="xref py py-obj docutils literal notranslate"><span class="pre">function</span></code></a>, <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.limits" title="sympy.concrete.expr_with_limits.ExprWithLimits.limits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">limits</span></code></a>, <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.free_symbols" title="sympy.concrete.expr_with_limits.ExprWithLimits.free_symbols"><code class="xref py py-obj docutils literal notranslate"><span class="pre">free_symbols</span></code></a></p>
<dl class="simple">
<dt><a class="reference internal" href="../core.html#sympy.core.basic.Basic.as_dummy" title="sympy.core.basic.Basic.as_dummy"><code class="xref py py-obj docutils literal notranslate"><span class="pre">as_dummy</span></code></a></dt><dd><p>Rename dummy variables</p>
</dd>
<dt><a class="reference internal" href="#sympy.integrals.integrals.Integral.transform" title="sympy.integrals.integrals.Integral.transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.Integral.transform</span></code></a></dt><dd><p>Perform mapping on the dummy variable</p>
</dd>
</dl>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.concrete.expr_with_limits.ExprWithLimits.free_symbols">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">free_symbols</span></span><a class="headerlink" href="#sympy.concrete.expr_with_limits.ExprWithLimits.free_symbols" title="Permalink to this definition">¶</a></dt>
<dd><p>This method returns the symbols in the object, excluding those
that take on a specific value (i.e. the dummy symbols).</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Sum</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Sum</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">free_symbols</span>
<span class="go">{y}</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.concrete.expr_with_limits.ExprWithLimits.function">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">function</span></span><a class="headerlink" href="#sympy.concrete.expr_with_limits.ExprWithLimits.function" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the function applied across limits.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Integral</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,))</span><span class="o">.</span><span class="n">function</span>
<span class="go">x**2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.limits" title="sympy.concrete.expr_with_limits.ExprWithLimits.limits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">limits</span></code></a>, <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.variables" title="sympy.concrete.expr_with_limits.ExprWithLimits.variables"><code class="xref py py-obj docutils literal notranslate"><span class="pre">variables</span></code></a>, <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.free_symbols" title="sympy.concrete.expr_with_limits.ExprWithLimits.free_symbols"><code class="xref py py-obj docutils literal notranslate"><span class="pre">free_symbols</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.concrete.expr_with_limits.ExprWithLimits.has_finite_limits">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">has_finite_limits</span></span><a class="headerlink" href="#sympy.concrete.expr_with_limits.ExprWithLimits.has_finite_limits" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if the limits are known to be finite, either by the
explicit bounds, assumptions on the bounds, or assumptions on the
variables.  False if known to be infinite, based on the bounds.
None if not enough information is available to determine.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Sum</span><span class="p">,</span> <span class="n">Integral</span><span class="p">,</span> <span class="n">Product</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Sum</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">8</span><span class="p">))</span><span class="o">.</span><span class="n">has_finite_limits</span>
<span class="go">True</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">oo</span><span class="p">))</span><span class="o">.</span><span class="n">has_finite_limits</span>
<span class="go">False</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;M&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Sum</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">M</span><span class="p">))</span><span class="o">.</span><span class="n">has_finite_limits</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">,</span> <span class="n">integer</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Product</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">N</span><span class="p">))</span><span class="o">.</span><span class="n">has_finite_limits</span>
<span class="go">True</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.has_reversed_limits" title="sympy.concrete.expr_with_limits.ExprWithLimits.has_reversed_limits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">has_reversed_limits</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.concrete.expr_with_limits.ExprWithLimits.has_reversed_limits">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">has_reversed_limits</span></span><a class="headerlink" href="#sympy.concrete.expr_with_limits.ExprWithLimits.has_reversed_limits" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if the limits are known to be in reversed order, either
by the explicit bounds, assumptions on the bounds, or assumptions on the
variables.  False if known to be in normal order, based on the bounds.
None if not enough information is available to determine.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Sum</span><span class="p">,</span> <span class="n">Integral</span><span class="p">,</span> <span class="n">Product</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Sum</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">has_reversed_limits</span>
<span class="go">True</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Sum</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">oo</span><span class="p">))</span><span class="o">.</span><span class="n">has_reversed_limits</span>
<span class="go">False</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">M</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;M&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">M</span><span class="p">))</span><span class="o">.</span><span class="n">has_reversed_limits</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">,</span> <span class="n">integer</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Sum</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">N</span><span class="p">))</span><span class="o">.</span><span class="n">has_reversed_limits</span>
<span class="go">False</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Product</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="n">N</span><span class="p">))</span><span class="o">.</span><span class="n">has_reversed_limits</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Product</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="n">N</span><span class="p">))</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">N</span> <span class="o">+</span> <span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">has_reversed_limits</span>
<span class="go">False</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../concrete.html#sympy.concrete.expr_with_intlimits.ExprWithIntLimits.has_empty_sequence" title="sympy.concrete.expr_with_intlimits.ExprWithIntLimits.has_empty_sequence"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.concrete.expr_with_intlimits.ExprWithIntLimits.has_empty_sequence</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.concrete.expr_with_limits.ExprWithLimits.is_number">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_number</span></span><a class="headerlink" href="#sympy.concrete.expr_with_limits.ExprWithLimits.is_number" title="Permalink to this definition">¶</a></dt>
<dd><p>Return True if the Sum has no free symbols, else False.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.concrete.expr_with_limits.ExprWithLimits.limits">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">limits</span></span><a class="headerlink" href="#sympy.concrete.expr_with_limits.ExprWithLimits.limits" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the limits of expression.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Integral</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">i</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Integral</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="n">i</span><span class="p">,</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span><span class="o">.</span><span class="n">limits</span>
<span class="go">((i, 1, 3),)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.function" title="sympy.concrete.expr_with_limits.ExprWithLimits.function"><code class="xref py py-obj docutils literal notranslate"><span class="pre">function</span></code></a>, <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.variables" title="sympy.concrete.expr_with_limits.ExprWithLimits.variables"><code class="xref py py-obj docutils literal notranslate"><span class="pre">variables</span></code></a>, <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.free_symbols" title="sympy.concrete.expr_with_limits.ExprWithLimits.free_symbols"><code class="xref py py-obj docutils literal notranslate"><span class="pre">free_symbols</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.concrete.expr_with_limits.ExprWithLimits.variables">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">variables</span></span><a class="headerlink" href="#sympy.concrete.expr_with_limits.ExprWithLimits.variables" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of the limit variables.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Sum</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">i</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Sum</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="n">i</span><span class="p">,</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span><span class="o">.</span><span class="n">variables</span>
<span class="go">[i]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.function" title="sympy.concrete.expr_with_limits.ExprWithLimits.function"><code class="xref py py-obj docutils literal notranslate"><span class="pre">function</span></code></a>, <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.limits" title="sympy.concrete.expr_with_limits.ExprWithLimits.limits"><code class="xref py py-obj docutils literal notranslate"><span class="pre">limits</span></code></a>, <a class="reference internal" href="#sympy.concrete.expr_with_limits.ExprWithLimits.free_symbols" title="sympy.concrete.expr_with_limits.ExprWithLimits.free_symbols"><code class="xref py py-obj docutils literal notranslate"><span class="pre">free_symbols</span></code></a></p>
<dl class="simple">
<dt><a class="reference internal" href="../core.html#sympy.core.basic.Basic.as_dummy" title="sympy.core.basic.Basic.as_dummy"><code class="xref py py-obj docutils literal notranslate"><span class="pre">as_dummy</span></code></a></dt><dd><p>Rename dummy variables</p>
</dd>
<dt><a class="reference internal" href="#sympy.integrals.integrals.Integral.transform" title="sympy.integrals.integrals.Integral.transform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.integrals.integrals.Integral.transform</span></code></a></dt><dd><p>Perform mapping on the dummy variable</p>
</dd>
</dl>
</div>
</dd></dl>

</dd></dl>

</section>
<section id="todo-and-bugs">
<h2>TODO and Bugs<a class="headerlink" href="#todo-and-bugs" title="Permalink to this headline">¶</a></h2>
<p>There are still lots of functions that SymPy does not know how to integrate. For bugs related to this module, see <a class="reference external" href="https://github.com/sympy/sympy/issues?q=is%3Aissue+is%3Aopen+label%3Aintegrals">https://github.com/sympy/sympy/issues?q=is%3Aissue+is%3Aopen+label%3Aintegrals</a></p>
<section id="numeric-integrals">
<h3>Numeric Integrals<a class="headerlink" href="#numeric-integrals" title="Permalink to this headline">¶</a></h3>
<p>SymPy has functions to calculate points and weights for Gaussian quadrature of
any order and any precision:</p>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.quadrature.gauss_legendre">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.quadrature.</span></span><span class="sig-name descname"><span class="pre">gauss_legendre</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_digits</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/quadrature.py#L11-L80"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.quadrature.gauss_legendre" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the Gauss-Legendre quadrature <a class="reference internal" href="#r499" id="id11"><span>[R499]</span></a> points and weights.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n :</strong></p>
<blockquote>
<div><p>The order of quadrature.</p>
</div></blockquote>
<p><strong>n_digits :</strong></p>
<blockquote>
<div><p>Number of significant digits of the points and weights to return.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>(x, w)</strong> : the <code class="docutils literal notranslate"><span class="pre">x</span></code> and <code class="docutils literal notranslate"><span class="pre">w</span></code> are lists of points and weights as Floats.</p>
<blockquote>
<div><p>The points <span class="math notranslate nohighlight">\(x_i\)</span> and weights <span class="math notranslate nohighlight">\(w_i\)</span> are returned as <code class="docutils literal notranslate"><span class="pre">(x,</span> <span class="pre">w)</span></code>
tuple of lists.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The Gauss-Legendre quadrature approximates the integral:</p>
<div class="math notranslate nohighlight">
\[\int_{-1}^1 f(x)\,dx \approx \sum_{i=1}^n w_i f(x_i)\]</div>
<p>The nodes <span class="math notranslate nohighlight">\(x_i\)</span> of an order <span class="math notranslate nohighlight">\(n\)</span> quadrature rule are the roots of <span class="math notranslate nohighlight">\(P_n\)</span>
and the weights <span class="math notranslate nohighlight">\(w_i\)</span> are given by:</p>
<div class="math notranslate nohighlight">
\[w_i = \frac{2}{\left(1-x_i^2\right) \left(P'_n(x_i)\right)^2}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.quadrature</span> <span class="kn">import</span> <span class="n">gauss_legendre</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_legendre</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[-0.7746, 0, 0.7746]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.55556, 0.88889, 0.55556]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_legendre</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[-0.86114, -0.33998, 0.33998, 0.86114]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.34785, 0.65215, 0.65215, 0.34785]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.quadrature.gauss_laguerre" title="sympy.integrals.quadrature.gauss_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_gen_laguerre" title="sympy.integrals.quadrature.gauss_gen_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_gen_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_hermite" title="sympy.integrals.quadrature.gauss_hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_hermite</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_t" title="sympy.integrals.quadrature.gauss_chebyshev_t"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_t</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_u" title="sympy.integrals.quadrature.gauss_chebyshev_u"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_u</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_jacobi" title="sympy.integrals.quadrature.gauss_jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_jacobi</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_lobatto" title="sympy.integrals.quadrature.gauss_lobatto"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_lobatto</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r499"><span class="brackets">R499</span><span class="fn-backref">(<a href="#id11">1</a>,<a href="#id12">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Gaussian_quadrature">https://en.wikipedia.org/wiki/Gaussian_quadrature</a></p>
</dd>
<dt class="label" id="r500"><span class="brackets"><a class="fn-backref" href="#id13">R500</a></span></dt>
<dd><p><a class="reference external" href="http://people.sc.fsu.edu/~jburkardt/cpp_src/legendre_rule/legendre_rule.html">http://people.sc.fsu.edu/~jburkardt/cpp_src/legendre_rule/legendre_rule.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.quadrature.gauss_laguerre">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.quadrature.</span></span><span class="sig-name descname"><span class="pre">gauss_laguerre</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_digits</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/quadrature.py#L83-L153"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.quadrature.gauss_laguerre" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the Gauss-Laguerre quadrature <a class="reference internal" href="#r501" id="id14"><span>[R501]</span></a> points and weights.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n :</strong></p>
<blockquote>
<div><p>The order of quadrature.</p>
</div></blockquote>
<p><strong>n_digits :</strong></p>
<blockquote>
<div><p>Number of significant digits of the points and weights to return.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>(x, w)</strong> : The <code class="docutils literal notranslate"><span class="pre">x</span></code> and <code class="docutils literal notranslate"><span class="pre">w</span></code> are lists of points and weights as Floats.</p>
<blockquote>
<div><p>The points <span class="math notranslate nohighlight">\(x_i\)</span> and weights <span class="math notranslate nohighlight">\(w_i\)</span> are returned as <code class="docutils literal notranslate"><span class="pre">(x,</span> <span class="pre">w)</span></code>
tuple of lists.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The Gauss-Laguerre quadrature approximates the integral:</p>
<div class="math notranslate nohighlight">
\[\int_0^{\infty} e^{-x} f(x)\,dx \approx \sum_{i=1}^n w_i f(x_i)\]</div>
<p>The nodes <span class="math notranslate nohighlight">\(x_i\)</span> of an order <span class="math notranslate nohighlight">\(n\)</span> quadrature rule are the roots of <span class="math notranslate nohighlight">\(L_n\)</span>
and the weights <span class="math notranslate nohighlight">\(w_i\)</span> are given by:</p>
<div class="math notranslate nohighlight">
\[w_i = \frac{x_i}{(n+1)^2 \left(L_{n+1}(x_i)\right)^2}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.quadrature</span> <span class="kn">import</span> <span class="n">gauss_laguerre</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_laguerre</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[0.41577, 2.2943, 6.2899]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.71109, 0.27852, 0.010389]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_laguerre</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[0.22285, 1.1889, 2.9927, 5.7751, 9.8375, 15.983]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.45896, 0.417, 0.11337, 0.010399, 0.00026102, 8.9855e-7]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.quadrature.gauss_legendre" title="sympy.integrals.quadrature.gauss_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_legendre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_gen_laguerre" title="sympy.integrals.quadrature.gauss_gen_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_gen_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_hermite" title="sympy.integrals.quadrature.gauss_hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_hermite</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_t" title="sympy.integrals.quadrature.gauss_chebyshev_t"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_t</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_u" title="sympy.integrals.quadrature.gauss_chebyshev_u"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_u</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_jacobi" title="sympy.integrals.quadrature.gauss_jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_jacobi</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_lobatto" title="sympy.integrals.quadrature.gauss_lobatto"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_lobatto</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r501"><span class="brackets">R501</span><span class="fn-backref">(<a href="#id14">1</a>,<a href="#id15">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Gauss–Laguerre_quadrature">https://en.wikipedia.org/wiki/Gauss%E2%80%93Laguerre_quadrature</a></p>
</dd>
<dt class="label" id="r502"><span class="brackets"><a class="fn-backref" href="#id16">R502</a></span></dt>
<dd><p><a class="reference external" href="http://people.sc.fsu.edu/~jburkardt/cpp_src/laguerre_rule/laguerre_rule.html">http://people.sc.fsu.edu/~jburkardt/cpp_src/laguerre_rule/laguerre_rule.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.quadrature.gauss_hermite">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.quadrature.</span></span><span class="sig-name descname"><span class="pre">gauss_hermite</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_digits</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/quadrature.py#L156-L229"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.quadrature.gauss_hermite" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the Gauss-Hermite quadrature <a class="reference internal" href="#r503" id="id17"><span>[R503]</span></a> points and weights.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n :</strong></p>
<blockquote>
<div><p>The order of quadrature.</p>
</div></blockquote>
<p><strong>n_digits :</strong></p>
<blockquote>
<div><p>Number of significant digits of the points and weights to return.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>(x, w)</strong> : The <code class="docutils literal notranslate"><span class="pre">x</span></code> and <code class="docutils literal notranslate"><span class="pre">w</span></code> are lists of points and weights as Floats.</p>
<blockquote>
<div><p>The points <span class="math notranslate nohighlight">\(x_i\)</span> and weights <span class="math notranslate nohighlight">\(w_i\)</span> are returned as <code class="docutils literal notranslate"><span class="pre">(x,</span> <span class="pre">w)</span></code>
tuple of lists.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The Gauss-Hermite quadrature approximates the integral:</p>
<div class="math notranslate nohighlight">
\[\int_{-\infty}^{\infty} e^{-x^2} f(x)\,dx \approx
    \sum_{i=1}^n w_i f(x_i)\]</div>
<p>The nodes <span class="math notranslate nohighlight">\(x_i\)</span> of an order <span class="math notranslate nohighlight">\(n\)</span> quadrature rule are the roots of <span class="math notranslate nohighlight">\(H_n\)</span>
and the weights <span class="math notranslate nohighlight">\(w_i\)</span> are given by:</p>
<div class="math notranslate nohighlight">
\[w_i = \frac{2^{n-1} n! \sqrt{\pi}}{n^2 \left(H_{n-1}(x_i)\right)^2}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.quadrature</span> <span class="kn">import</span> <span class="n">gauss_hermite</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_hermite</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[-1.2247, 0, 1.2247]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.29541, 1.1816, 0.29541]</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_hermite</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[-2.3506, -1.3358, -0.43608, 0.43608, 1.3358, 2.3506]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.00453, 0.15707, 0.72463, 0.72463, 0.15707, 0.00453]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.quadrature.gauss_legendre" title="sympy.integrals.quadrature.gauss_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_legendre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_laguerre" title="sympy.integrals.quadrature.gauss_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_gen_laguerre" title="sympy.integrals.quadrature.gauss_gen_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_gen_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_t" title="sympy.integrals.quadrature.gauss_chebyshev_t"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_t</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_u" title="sympy.integrals.quadrature.gauss_chebyshev_u"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_u</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_jacobi" title="sympy.integrals.quadrature.gauss_jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_jacobi</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_lobatto" title="sympy.integrals.quadrature.gauss_lobatto"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_lobatto</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r503"><span class="brackets">R503</span><span class="fn-backref">(<a href="#id17">1</a>,<a href="#id18">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Gauss-Hermite_Quadrature">https://en.wikipedia.org/wiki/Gauss-Hermite_Quadrature</a></p>
</dd>
<dt class="label" id="r504"><span class="brackets"><a class="fn-backref" href="#id19">R504</a></span></dt>
<dd><p><a class="reference external" href="http://people.sc.fsu.edu/~jburkardt/cpp_src/hermite_rule/hermite_rule.html">http://people.sc.fsu.edu/~jburkardt/cpp_src/hermite_rule/hermite_rule.html</a></p>
</dd>
<dt class="label" id="r505"><span class="brackets"><a class="fn-backref" href="#id20">R505</a></span></dt>
<dd><p><a class="reference external" href="http://people.sc.fsu.edu/~jburkardt/cpp_src/gen_hermite_rule/gen_hermite_rule.html">http://people.sc.fsu.edu/~jburkardt/cpp_src/gen_hermite_rule/gen_hermite_rule.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.quadrature.gauss_gen_laguerre">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.quadrature.</span></span><span class="sig-name descname"><span class="pre">gauss_gen_laguerre</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">alpha</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_digits</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/quadrature.py#L232-L311"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.quadrature.gauss_gen_laguerre" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the generalized Gauss-Laguerre quadrature <a class="reference internal" href="#r506" id="id21"><span>[R506]</span></a> points and weights.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n :</strong></p>
<blockquote>
<div><p>The order of quadrature.</p>
</div></blockquote>
<p><strong>alpha :</strong></p>
<blockquote>
<div><p>The exponent of the singularity, <span class="math notranslate nohighlight">\(\alpha &gt; -1\)</span>.</p>
</div></blockquote>
<p><strong>n_digits :</strong></p>
<blockquote>
<div><p>Number of significant digits of the points and weights to return.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>(x, w)</strong> : the <code class="docutils literal notranslate"><span class="pre">x</span></code> and <code class="docutils literal notranslate"><span class="pre">w</span></code> are lists of points and weights as Floats.</p>
<blockquote>
<div><p>The points <span class="math notranslate nohighlight">\(x_i\)</span> and weights <span class="math notranslate nohighlight">\(w_i\)</span> are returned as <code class="docutils literal notranslate"><span class="pre">(x,</span> <span class="pre">w)</span></code>
tuple of lists.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The generalized Gauss-Laguerre quadrature approximates the integral:</p>
<div class="math notranslate nohighlight">
\[\int_{0}^\infty x^{\alpha} e^{-x} f(x)\,dx \approx
    \sum_{i=1}^n w_i f(x_i)\]</div>
<p>The nodes <span class="math notranslate nohighlight">\(x_i\)</span> of an order <span class="math notranslate nohighlight">\(n\)</span> quadrature rule are the roots of
<span class="math notranslate nohighlight">\(L^{\alpha}_n\)</span> and the weights <span class="math notranslate nohighlight">\(w_i\)</span> are given by:</p>
<div class="math notranslate nohighlight">
\[w_i = \frac{\Gamma(\alpha+n)}
        {n \Gamma(n) L^{\alpha}_{n-1}(x_i) L^{\alpha+1}_{n-1}(x_i)}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.quadrature</span> <span class="kn">import</span> <span class="n">gauss_gen_laguerre</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_gen_laguerre</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="o">-</span><span class="n">S</span><span class="o">.</span><span class="n">Half</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[0.19016, 1.7845, 5.5253]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[1.4493, 0.31413, 0.00906]</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_gen_laguerre</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">3</span><span class="o">*</span><span class="n">S</span><span class="o">.</span><span class="n">Half</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[0.97851, 2.9904, 6.3193, 11.712]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.53087, 0.67721, 0.11895, 0.0023152]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.quadrature.gauss_legendre" title="sympy.integrals.quadrature.gauss_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_legendre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_laguerre" title="sympy.integrals.quadrature.gauss_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_hermite" title="sympy.integrals.quadrature.gauss_hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_hermite</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_t" title="sympy.integrals.quadrature.gauss_chebyshev_t"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_t</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_u" title="sympy.integrals.quadrature.gauss_chebyshev_u"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_u</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_jacobi" title="sympy.integrals.quadrature.gauss_jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_jacobi</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_lobatto" title="sympy.integrals.quadrature.gauss_lobatto"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_lobatto</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r506"><span class="brackets">R506</span><span class="fn-backref">(<a href="#id21">1</a>,<a href="#id22">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Gauss–Laguerre_quadrature">https://en.wikipedia.org/wiki/Gauss%E2%80%93Laguerre_quadrature</a></p>
</dd>
<dt class="label" id="r507"><span class="brackets"><a class="fn-backref" href="#id23">R507</a></span></dt>
<dd><p><a class="reference external" href="http://people.sc.fsu.edu/~jburkardt/cpp_src/gen_laguerre_rule/gen_laguerre_rule.html">http://people.sc.fsu.edu/~jburkardt/cpp_src/gen_laguerre_rule/gen_laguerre_rule.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.quadrature.gauss_chebyshev_t">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.quadrature.</span></span><span class="sig-name descname"><span class="pre">gauss_chebyshev_t</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_digits</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/quadrature.py#L314-L382"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.quadrature.gauss_chebyshev_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the Gauss-Chebyshev quadrature <a class="reference internal" href="#r508" id="id24"><span>[R508]</span></a> points and weights of
the first kind.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n :</strong></p>
<blockquote>
<div><p>The order of quadrature.</p>
</div></blockquote>
<p><strong>n_digits :</strong></p>
<blockquote>
<div><p>Number of significant digits of the points and weights to return.</p>
</div></blockquote>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>(x, w)</strong> : the <code class="docutils literal notranslate"><span class="pre">x</span></code> and <code class="docutils literal notranslate"><span class="pre">w</span></code> are lists of points and weights as Floats.</p>
<blockquote>
<div><p>The points <span class="math notranslate nohighlight">\(x_i\)</span> and weights <span class="math notranslate nohighlight">\(w_i\)</span> are returned as <code class="docutils literal notranslate"><span class="pre">(x,</span> <span class="pre">w)</span></code>
tuple of lists.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The Gauss-Chebyshev quadrature of the first kind approximates the integral:</p>
<div class="math notranslate nohighlight">
\[\int_{-1}^{1} \frac{1}{\sqrt{1-x^2}} f(x)\,dx \approx
    \sum_{i=1}^n w_i f(x_i)\]</div>
<p>The nodes <span class="math notranslate nohighlight">\(x_i\)</span> of an order <span class="math notranslate nohighlight">\(n\)</span> quadrature rule are the roots of <span class="math notranslate nohighlight">\(T_n\)</span>
and the weights <span class="math notranslate nohighlight">\(w_i\)</span> are given by:</p>
<div class="math notranslate nohighlight">
\[w_i = \frac{\pi}{n}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.quadrature</span> <span class="kn">import</span> <span class="n">gauss_chebyshev_t</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_chebyshev_t</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[0.86602, 0, -0.86602]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[1.0472, 1.0472, 1.0472]</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_chebyshev_t</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[0.96593, 0.70711, 0.25882, -0.25882, -0.70711, -0.96593]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.5236, 0.5236, 0.5236, 0.5236, 0.5236, 0.5236]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.quadrature.gauss_legendre" title="sympy.integrals.quadrature.gauss_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_legendre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_laguerre" title="sympy.integrals.quadrature.gauss_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_hermite" title="sympy.integrals.quadrature.gauss_hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_hermite</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_gen_laguerre" title="sympy.integrals.quadrature.gauss_gen_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_gen_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_u" title="sympy.integrals.quadrature.gauss_chebyshev_u"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_u</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_jacobi" title="sympy.integrals.quadrature.gauss_jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_jacobi</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_lobatto" title="sympy.integrals.quadrature.gauss_lobatto"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_lobatto</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r508"><span class="brackets">R508</span><span class="fn-backref">(<a href="#id24">1</a>,<a href="#id25">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Chebyshev–Gauss_quadrature">https://en.wikipedia.org/wiki/Chebyshev%E2%80%93Gauss_quadrature</a></p>
</dd>
<dt class="label" id="r509"><span class="brackets"><a class="fn-backref" href="#id26">R509</a></span></dt>
<dd><p><a class="reference external" href="http://people.sc.fsu.edu/~jburkardt/cpp_src/chebyshev1_rule/chebyshev1_rule.html">http://people.sc.fsu.edu/~jburkardt/cpp_src/chebyshev1_rule/chebyshev1_rule.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.quadrature.gauss_chebyshev_u">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.quadrature.</span></span><span class="sig-name descname"><span class="pre">gauss_chebyshev_u</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_digits</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/quadrature.py#L385-L451"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.quadrature.gauss_chebyshev_u" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the Gauss-Chebyshev quadrature <a class="reference internal" href="#r510" id="id27"><span>[R510]</span></a> points and weights of
the second kind.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> : the order of quadrature</p>
<p><strong>n_digits</strong> : number of significant digits of the points and weights to return</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>(x, w)</strong> : the <code class="docutils literal notranslate"><span class="pre">x</span></code> and <code class="docutils literal notranslate"><span class="pre">w</span></code> are lists of points and weights as Floats.</p>
<blockquote>
<div><p>The points <span class="math notranslate nohighlight">\(x_i\)</span> and weights <span class="math notranslate nohighlight">\(w_i\)</span> are returned as <code class="docutils literal notranslate"><span class="pre">(x,</span> <span class="pre">w)</span></code>
tuple of lists.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The Gauss-Chebyshev quadrature of the second kind approximates the
integral:</p>
<div class="math notranslate nohighlight">
\[\int_{-1}^{1} \sqrt{1-x^2} f(x)\,dx \approx \sum_{i=1}^n w_i f(x_i)\]</div>
<p>The nodes <span class="math notranslate nohighlight">\(x_i\)</span> of an order <span class="math notranslate nohighlight">\(n\)</span> quadrature rule are the roots of <span class="math notranslate nohighlight">\(U_n\)</span>
and the weights <span class="math notranslate nohighlight">\(w_i\)</span> are given by:</p>
<div class="math notranslate nohighlight">
\[w_i = \frac{\pi}{n+1} \sin^2 \left(\frac{i}{n+1}\pi\right)\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.quadrature</span> <span class="kn">import</span> <span class="n">gauss_chebyshev_u</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_chebyshev_u</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[0.70711, 0, -0.70711]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.3927, 0.7854, 0.3927]</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_chebyshev_u</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[0.90097, 0.62349, 0.22252, -0.22252, -0.62349, -0.90097]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.084489, 0.27433, 0.42658, 0.42658, 0.27433, 0.084489]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.quadrature.gauss_legendre" title="sympy.integrals.quadrature.gauss_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_legendre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_laguerre" title="sympy.integrals.quadrature.gauss_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_hermite" title="sympy.integrals.quadrature.gauss_hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_hermite</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_gen_laguerre" title="sympy.integrals.quadrature.gauss_gen_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_gen_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_t" title="sympy.integrals.quadrature.gauss_chebyshev_t"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_t</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_jacobi" title="sympy.integrals.quadrature.gauss_jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_jacobi</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_lobatto" title="sympy.integrals.quadrature.gauss_lobatto"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_lobatto</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r510"><span class="brackets">R510</span><span class="fn-backref">(<a href="#id27">1</a>,<a href="#id28">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Chebyshev–Gauss_quadrature">https://en.wikipedia.org/wiki/Chebyshev%E2%80%93Gauss_quadrature</a></p>
</dd>
<dt class="label" id="r511"><span class="brackets"><a class="fn-backref" href="#id29">R511</a></span></dt>
<dd><p><a class="reference external" href="http://people.sc.fsu.edu/~jburkardt/cpp_src/chebyshev2_rule/chebyshev2_rule.html">http://people.sc.fsu.edu/~jburkardt/cpp_src/chebyshev2_rule/chebyshev2_rule.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.quadrature.gauss_jacobi">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.quadrature.</span></span><span class="sig-name descname"><span class="pre">gauss_jacobi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">alpha</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">beta</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_digits</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/quadrature.py#L454-L540"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.quadrature.gauss_jacobi" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the Gauss-Jacobi quadrature <a class="reference internal" href="#r512" id="id30"><span>[R512]</span></a> points and weights.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> : the order of quadrature</p>
<p><strong>alpha</strong> : the first parameter of the Jacobi Polynomial, <span class="math notranslate nohighlight">\(\alpha &gt; -1\)</span></p>
<p><strong>beta</strong> : the second parameter of the Jacobi Polynomial, <span class="math notranslate nohighlight">\(\beta &gt; -1\)</span></p>
<p><strong>n_digits</strong> : number of significant digits of the points and weights to return</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>(x, w)</strong> : the <code class="docutils literal notranslate"><span class="pre">x</span></code> and <code class="docutils literal notranslate"><span class="pre">w</span></code> are lists of points and weights as Floats.</p>
<blockquote>
<div><p>The points <span class="math notranslate nohighlight">\(x_i\)</span> and weights <span class="math notranslate nohighlight">\(w_i\)</span> are returned as <code class="docutils literal notranslate"><span class="pre">(x,</span> <span class="pre">w)</span></code>
tuple of lists.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The Gauss-Jacobi quadrature of the first kind approximates the integral:</p>
<div class="math notranslate nohighlight">
\[\int_{-1}^1 (1-x)^\alpha (1+x)^\beta f(x)\,dx \approx
    \sum_{i=1}^n w_i f(x_i)\]</div>
<p>The nodes <span class="math notranslate nohighlight">\(x_i\)</span> of an order <span class="math notranslate nohighlight">\(n\)</span> quadrature rule are the roots of
<span class="math notranslate nohighlight">\(P^{(\alpha,\beta)}_n\)</span> and the weights <span class="math notranslate nohighlight">\(w_i\)</span> are given by:</p>
<div class="math notranslate nohighlight">
\[w_i = -\frac{2n+\alpha+\beta+2}{n+\alpha+\beta+1}
      \frac{\Gamma(n+\alpha+1)\Gamma(n+\beta+1)}
      {\Gamma(n+\alpha+\beta+1)(n+1)!}
      \frac{2^{\alpha+\beta}}{P'_n(x_i)
      P^{(\alpha,\beta)}_{n+1}(x_i)}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.quadrature</span> <span class="kn">import</span> <span class="n">gauss_jacobi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_jacobi</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">S</span><span class="o">.</span><span class="n">Half</span><span class="p">,</span> <span class="o">-</span><span class="n">S</span><span class="o">.</span><span class="n">Half</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[-0.90097, -0.22252, 0.62349]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[1.7063, 1.0973, 0.33795]</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_jacobi</span><span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[-0.87174, -0.5917, -0.2093, 0.2093, 0.5917, 0.87174]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.050584, 0.22169, 0.39439, 0.39439, 0.22169, 0.050584]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.quadrature.gauss_legendre" title="sympy.integrals.quadrature.gauss_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_legendre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_laguerre" title="sympy.integrals.quadrature.gauss_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_hermite" title="sympy.integrals.quadrature.gauss_hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_hermite</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_gen_laguerre" title="sympy.integrals.quadrature.gauss_gen_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_gen_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_t" title="sympy.integrals.quadrature.gauss_chebyshev_t"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_t</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_u" title="sympy.integrals.quadrature.gauss_chebyshev_u"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_u</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_lobatto" title="sympy.integrals.quadrature.gauss_lobatto"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_lobatto</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r512"><span class="brackets">R512</span><span class="fn-backref">(<a href="#id30">1</a>,<a href="#id31">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Gauss–Jacobi_quadrature">https://en.wikipedia.org/wiki/Gauss%E2%80%93Jacobi_quadrature</a></p>
</dd>
<dt class="label" id="r513"><span class="brackets"><a class="fn-backref" href="#id32">R513</a></span></dt>
<dd><p><a class="reference external" href="http://people.sc.fsu.edu/~jburkardt/cpp_src/jacobi_rule/jacobi_rule.html">http://people.sc.fsu.edu/~jburkardt/cpp_src/jacobi_rule/jacobi_rule.html</a></p>
</dd>
<dt class="label" id="r514"><span class="brackets"><a class="fn-backref" href="#id33">R514</a></span></dt>
<dd><p><a class="reference external" href="http://people.sc.fsu.edu/~jburkardt/cpp_src/gegenbauer_rule/gegenbauer_rule.html">http://people.sc.fsu.edu/~jburkardt/cpp_src/gegenbauer_rule/gegenbauer_rule.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.quadrature.gauss_lobatto">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.quadrature.</span></span><span class="sig-name descname"><span class="pre">gauss_lobatto</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_digits</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/quadrature.py#L543-L617"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.quadrature.gauss_lobatto" title="Permalink to this definition">¶</a></dt>
<dd><p>Computes the Gauss-Lobatto quadrature <a class="reference internal" href="#r515" id="id34"><span>[R515]</span></a> points and weights.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> : the order of quadrature</p>
<p><strong>n_digits</strong> : number of significant digits of the points and weights to return</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>(x, w)</strong> : the <code class="docutils literal notranslate"><span class="pre">x</span></code> and <code class="docutils literal notranslate"><span class="pre">w</span></code> are lists of points and weights as Floats.</p>
<blockquote>
<div><p>The points <span class="math notranslate nohighlight">\(x_i\)</span> and weights <span class="math notranslate nohighlight">\(w_i\)</span> are returned as <code class="docutils literal notranslate"><span class="pre">(x,</span> <span class="pre">w)</span></code>
tuple of lists.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The Gauss-Lobatto quadrature approximates the integral:</p>
<div class="math notranslate nohighlight">
\[\int_{-1}^1 f(x)\,dx \approx \sum_{i=1}^n w_i f(x_i)\]</div>
<p>The nodes <span class="math notranslate nohighlight">\(x_i\)</span> of an order <span class="math notranslate nohighlight">\(n\)</span> quadrature rule are the roots of <span class="math notranslate nohighlight">\(P'_(n-1)\)</span>
and the weights <span class="math notranslate nohighlight">\(w_i\)</span> are given by:</p>
<div class="math notranslate nohighlight">
\[\begin{split}&amp;w_i = \frac{2}{n(n-1) \left[P_{n-1}(x_i)\right]^2},\quad x\neq\pm 1\\
&amp;w_i = \frac{2}{n(n-1)},\quad x=\pm 1\end{split}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.quadrature</span> <span class="kn">import</span> <span class="n">gauss_lobatto</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_lobatto</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[-1, 0, 1]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.33333, 1.3333, 0.33333]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">w</span> <span class="o">=</span> <span class="n">gauss_lobatto</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">[-1, -0.44721, 0.44721, 1]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">w</span>
<span class="go">[0.16667, 0.83333, 0.83333, 0.16667]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.integrals.quadrature.gauss_legendre" title="sympy.integrals.quadrature.gauss_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_legendre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_laguerre" title="sympy.integrals.quadrature.gauss_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_gen_laguerre" title="sympy.integrals.quadrature.gauss_gen_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_gen_laguerre</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_hermite" title="sympy.integrals.quadrature.gauss_hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_hermite</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_t" title="sympy.integrals.quadrature.gauss_chebyshev_t"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_t</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_chebyshev_u" title="sympy.integrals.quadrature.gauss_chebyshev_u"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_chebyshev_u</span></code></a>, <a class="reference internal" href="#sympy.integrals.quadrature.gauss_jacobi" title="sympy.integrals.quadrature.gauss_jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gauss_jacobi</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r515"><span class="brackets">R515</span><span class="fn-backref">(<a href="#id34">1</a>,<a href="#id35">2</a>)</span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Gaussian_quadrature#Gauss.E2.80.93Lobatto_rules">https://en.wikipedia.org/wiki/Gaussian_quadrature#Gauss.E2.80.93Lobatto_rules</a></p>
</dd>
<dt class="label" id="r516"><span class="brackets"><a class="fn-backref" href="#id36">R516</a></span></dt>
<dd><p><a class="reference external" href="http://people.math.sfu.ca/~cbm/aands/page_888.htm">http://people.math.sfu.ca/~cbm/aands/page_888.htm</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-sympy.integrals.intpoly">
<span id="integration-over-polytopes"></span><h3>Integration over Polytopes<a class="headerlink" href="#module-sympy.integrals.intpoly" title="Permalink to this headline">¶</a></h3>
<p>The <code class="docutils literal notranslate"><span class="pre">intpoly</span></code> module in SymPy implements methods to calculate the integral of a polynomial over 2/3-Polytopes.
Uses evaluation techniques as described in Chin et al. (2015) [1].</p>
<p>The input for 2-Polytope or Polygon uses the already existing <code class="docutils literal notranslate"><span class="pre">Polygon</span></code> data structure in SymPy. See
<a class="reference internal" href="../geometry/polygons.html#module-sympy.geometry.polygon" title="sympy.geometry.polygon"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sympy.geometry.polygon</span></code></a> for how to create a polygon.</p>
<p>For the 3-Polytope or Polyhedron, the most economical representation
is to specify a list of vertices and then to provide each constituting face(Polygon) as a list of vertex indices.</p>
<p>For example, consider the unit cube. Here is how it would be represented.</p>
<dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">unit_cube</span> <span class="pre">=</span> <span class="pre">[[(0,</span> <span class="pre">0,</span> <span class="pre">0),</span> <span class="pre">(0,</span> <span class="pre">0,</span> <span class="pre">1),</span> <span class="pre">(0,</span> <span class="pre">1,</span> <span class="pre">0),</span> <span class="pre">(0,</span> <span class="pre">1,</span> <span class="pre">1),</span> <span class="pre">(1,</span> <span class="pre">0,</span> <span class="pre">0),(1,</span> <span class="pre">0,</span> <span class="pre">1),</span> <span class="pre">(1,</span> <span class="pre">1,</span> <span class="pre">0),</span> <span class="pre">(1,</span> <span class="pre">1,</span> <span class="pre">1)],</span></code></dt><dd><p><code class="docutils literal notranslate"><span class="pre">[3,</span> <span class="pre">7,</span> <span class="pre">6,</span> <span class="pre">2],</span> <span class="pre">[1,</span> <span class="pre">5,</span> <span class="pre">7,</span> <span class="pre">3],</span> <span class="pre">[5,</span> <span class="pre">4,</span> <span class="pre">6,</span> <span class="pre">7],</span> <span class="pre">[0,</span> <span class="pre">4,</span> <span class="pre">5,</span> <span class="pre">1],</span> <span class="pre">[2,</span> <span class="pre">0,</span> <span class="pre">1,</span> <span class="pre">3],</span> <span class="pre">[2,</span> <span class="pre">6,</span> <span class="pre">4,</span> <span class="pre">0]]</span></code></p>
</dd>
</dl>
<p>Here, the first sublist is the list of vertices. The other smaller lists such as <code class="docutils literal notranslate"><span class="pre">[3,</span> <span class="pre">7,</span> <span class="pre">6,</span> <span class="pre">2]</span></code> represent a 2D face
of the polyhedra with vertices having index <code class="docutils literal notranslate"><span class="pre">3,</span> <span class="pre">7,</span> <span class="pre">6</span> <span class="pre">and</span> <span class="pre">2</span></code> in the first sublist(in that order).</p>
<p>Principal method in this module is <a class="reference internal" href="#sympy.integrals.intpoly.polytope_integrate" title="sympy.integrals.intpoly.polytope_integrate"><code class="xref py py-func docutils literal notranslate"><span class="pre">polytope_integrate()</span></code></a></p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">polytope_integrate(Polygon((0,</span> <span class="pre">0),</span> <span class="pre">(0,</span> <span class="pre">1),</span> <span class="pre">(1,</span> <span class="pre">0)),</span> <span class="pre">x)</span></code> returns the integral of <span class="math notranslate nohighlight">\(x\)</span> over the triangle with vertices (0, 0), (0, 1) and (1, 0)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">polytope_integrate(unit_cube,</span> <span class="pre">x</span> <span class="pre">+</span> <span class="pre">y</span> <span class="pre">+</span> <span class="pre">z)</span></code> returns the integral of <span class="math notranslate nohighlight">\(x + y + z\)</span> over the unit cube.</p></li>
</ul>
</div></blockquote>
</section>
</section>
<section id="references">
<h2>References<a class="headerlink" href="#references" title="Permalink to this headline">¶</a></h2>
<p>[1] : Chin, Eric B., Jean B. Lasserre, and N. Sukumar. “Numerical integration of homogeneous functions on convex and nonconvex polygons and polyhedra.” Computational Mechanics 56.6 (2015): 967-981</p>
<p>PDF link : <a class="reference external" href="http://dilbert.engr.ucdavis.edu/~suku/quadrature/cls-integration.pdf">http://dilbert.engr.ucdavis.edu/~suku/quadrature/cls-integration.pdf</a></p>
</section>
<section id="id37">
<h2>Examples<a class="headerlink" href="#id37" title="Permalink to this headline">¶</a></h2>
</section>
<section id="for-2d-polygons">
<h2>For 2D Polygons<a class="headerlink" href="#for-2d-polygons" title="Permalink to this headline">¶</a></h2>
<p>Single Polynomial:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.intpoly</span> <span class="kn">import</span> <span class="o">*</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">init_printing</span><span class="p">(</span><span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">wrap_line</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">Polygon</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1/6</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">Polygon</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span> <span class="n">x</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
<span class="go">7/24</span>
</pre></div>
</div>
<p>List of specified polynomials:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">Polygon</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">4</span><span class="p">],</span> <span class="n">max_degree</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span>
<span class="go">          4               2</span>
<span class="go">{3: 3/2, x : 1/30, x*y + y : 1/8}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">Polygon</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span> <span class="p">[</span><span class="mf">1.125</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="mf">6.89</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span><span class="p">,</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">4</span><span class="p">],</span> <span class="n">max_degree</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span>
<span class="go">                       2              3  689    4               2</span>
<span class="go">{1.125: 9/16, x: 1/6, x : 1/12, 6.89*x : ----, x : 1/30, x*y + y : 1/8}</span>
<span class="go">                                         2000</span>
</pre></div>
</div>
<p>Computing all monomials up to a maximum degree:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">Polygon</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span><span class="n">max_degree</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="go">                        2         3                 2         3                      2         2</span>
<span class="go">{0: 0, 1: 1/2, x: 1/6, x : 1/12, x : 1/20, y: 1/6, y : 1/12, y : 1/20, x*y: 1/24, x*y : 1/60, x *y: 1/60}</span>
</pre></div>
</div>
</section>
<section id="for-3-polytopes-polyhedra">
<h2>For 3-Polytopes/Polyhedra<a class="headerlink" href="#for-3-polytopes-polyhedra" title="Permalink to this headline">¶</a></h2>
<p>Single Polynomial:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.intpoly</span> <span class="kn">import</span> <span class="o">*</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cube</span> <span class="o">=</span> <span class="p">[[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">)],</span> <span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">3</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">7</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">2</span><span class="p">]]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">cube</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">z</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">y</span><span class="o">*</span><span class="n">z</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="go">-21875/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">octahedron</span> <span class="o">=</span> <span class="p">[[(</span><span class="n">S</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">],</span> <span class="p">[</span><span class="mi">4</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">],</span> <span class="p">[</span><span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">5</span><span class="p">],</span> <span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">5</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">]]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">octahedron</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">z</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">y</span><span class="o">*</span><span class="n">z</span> <span class="o">+</span> <span class="n">x</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="go">  ___</span>
<span class="go">\/ 2</span>
<span class="go">-----</span>
<span class="go">  20</span>
</pre></div>
</div>
<p>List of specified polynomials:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">Polygon</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">4</span><span class="p">],</span> <span class="n">max_degree</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span>
<span class="go">          4               2</span>
<span class="go">{3: 3/2, x : 1/30, x*y + y : 1/8}</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">Polygon</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span> <span class="p">[</span><span class="mf">1.125</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="mf">6.89</span><span class="o">*</span><span class="n">x</span><span class="o">**</span><span class="mi">3</span><span class="p">,</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span> <span class="o">+</span> <span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">4</span><span class="p">],</span> <span class="n">max_degree</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span>
<span class="go">                       2              3  689    4               2</span>
<span class="go">{1.125: 9/16, x: 1/6, x : 1/12, 6.89*x : ----, x : 1/30, x*y + y : 1/8}</span>
<span class="go">                                         2000</span>
</pre></div>
</div>
<p>Computing all monomials up to a maximum degree:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">Polygon</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)),</span><span class="n">max_degree</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="go">                        2         3                 2         3                      2         2</span>
<span class="go">{0: 0, 1: 1/2, x: 1/6, x : 1/12, x : 1/20, y: 1/6, y : 1/12, y : 1/20, x*y: 1/24, x*y : 1/60, x *y: 1/60}</span>
</pre></div>
</div>
</section>
<section id="id38">
<h2>API reference<a class="headerlink" href="#id38" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.integrals.intpoly.polytope_integrate">
<span class="sig-prename descclassname"><span class="pre">sympy.integrals.intpoly.</span></span><span class="sig-name descname"><span class="pre">polytope_integrate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">poly</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">expr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">clockwise</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">max_degree</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/integrals/intpoly.py#L28-L135"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.integrals.intpoly.polytope_integrate" title="Permalink to this definition">¶</a></dt>
<dd><p>Integrates polynomials over 2/3-Polytopes.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>poly</strong> : The input Polygon.</p>
<p><strong>expr</strong> : The input polynomial.</p>
<p><strong>clockwise</strong> : Binary value to sort input points of 2-Polytope clockwise.(Optional)</p>
<p><strong>max_degree</strong> : The maximum degree of any monomial of the input polynomial.(Optional)</p>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>This function accepts the polytope in <code class="docutils literal notranslate"><span class="pre">poly</span></code> and the function in <code class="docutils literal notranslate"><span class="pre">expr</span></code>
(uni/bi/trivariate polynomials are implemented) and returns
the exact integral of <code class="docutils literal notranslate"><span class="pre">expr</span></code> over <code class="docutils literal notranslate"><span class="pre">poly</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.geometry.polygon</span> <span class="kn">import</span> <span class="n">Polygon</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.geometry.point</span> <span class="kn">import</span> <span class="n">Point</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.integrals.intpoly</span> <span class="kn">import</span> <span class="n">polytope_integrate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygon</span> <span class="o">=</span> <span class="n">Polygon</span><span class="p">(</span><span class="n">Point</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">Point</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="n">Point</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="n">Point</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polys</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="o">**</span><span class="mi">2</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr</span> <span class="o">=</span> <span class="n">x</span><span class="o">*</span><span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">polygon</span><span class="p">,</span> <span class="n">expr</span><span class="p">)</span>
<span class="go">1/4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polytope_integrate</span><span class="p">(</span><span class="n">polygon</span><span class="p">,</span> <span class="n">polys</span><span class="p">,</span> <span class="n">max_degree</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="go">{1: 1, x: 1/2, y: 1/2, x*y: 1/4, x*y**2: 1/6, x**2*y: 1/6}</span>
</pre></div>
</div>
</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Integrals</a><ul>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#module-sympy.integrals.transforms">Integral Transforms</a></li>
<li><a class="reference internal" href="#internals">Internals</a></li>
<li><a class="reference internal" href="#api-reference">API reference</a></li>
<li><a class="reference internal" href="#todo-and-bugs">TODO and Bugs</a><ul>
<li><a class="reference internal" href="#numeric-integrals">Numeric Integrals</a></li>
<li><a class="reference internal" href="#module-sympy.integrals.intpoly">Integration over Polytopes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#references">References</a></li>
<li><a class="reference internal" href="#id37">Examples</a></li>
<li><a class="reference internal" href="#for-2d-polygons">For 2D Polygons</a></li>
<li><a class="reference internal" href="#for-3-polytopes-polyhedra">For 3-Polytopes/Polyhedra</a></li>
<li><a class="reference internal" href="#id38">API reference</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="../solvers/inequalities.html"
                        title="previous chapter">Inequality Solvers</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="g-functions.html"
                        title="next chapter">Computing Integrals using Meijer G-Functions</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/modules/integrals/integrals.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="g-functions.html" title="Computing Integrals using Meijer G-Functions"
             >next</a> |</li>
        <li class="right" >
          <a href="../solvers/inequalities.html" title="Inequality Solvers"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Integrals</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/integrals/integrals.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:24:28 GMT -->
</html>